A confounding problem is that - even if you have scrutinised the timetable and correctly identified the flights which will be operated as pairs on the same aircraft - circumstances can still get in the way to trip you up. It's not a foolproof method.
There are all sorts of reasons why BA might have a spare aircraft on the ground at MAD (perhaps it diverted there, or went tech yesterday, or all sorts of irrops reasons). If your inbound is delayed, the return flight it was due to operate may be reassigned to another bird.
Unusual, of course, but at a station with so many rotations it can happen. Much to the delight of the passengers whose LHR flight is no longer delayed...