If I am reading it right, and the flights are the same calendar day, then it makes no difference. The test can be taken at any time on the previous calendar day.
Definately get it done at MAN.
While you could in theory go landside at LHR and get a rapid test at T5, I'd expect you'd get a lot of hassle at MAN when you tried to check-in without the test.