Upvote:-2
Your plans are fine under the VWP rules you mentioned. See below for issues about going to visit a fiancee.
The key phrase you cited is "as long as the trip does not terminate in contiguous territory or an adjacent island". This is because the 90 days allowed under VWP may include any time you spend in continguous territories or adjacent islands after entering the US.
Allowed under VWP (what you asked about): UK to Mexico, Mexico to US, US back to Mexico, Mexico back to UK, all within 90 days and all tickets in hand.
Disallowed: UK to US, stay for 40 days, US to Mexico, stay in Mexico for 40 days, return to US and stay another 11 days. Disallowed because you would stay in the US past 90 days from the initial US entry.
Gray area: UK to US, stay for 40 days, US to Mexico, stay for 6 months. Gray area because it is unclear whether staying in Mexico for 6 months counts as terminating the trip there. Probably still acceptable as long as you already have tickets out of Mexico and can clearly explain your plans.
===
You also mentioned "to see my fiancee". This can be a potential problem because some US officials (incorrectly) think that entering the US to see one's fiancee should only be done with a K-1 fiancee visa. Under 9 FAM 402.2-4(B)(1) you should be able to get a tourist visa to visit your fiancee temporarily, which implies that it should also be possible to do so under VWP. Here are some more resources about this issue: 1, 2, 3.