For that kind of savings, I'd consider flying one way down to Cabo in order to pick up the flight back and make it all legit.
The other problem is that your bags will be checked through to Madrid; if your "real" destination is London, you better travel with just carry-ons.