As with most tax declarations, it is most likely up to you to report this correctly, and HMRC will not automatically consult other people's records to come up with their own answer for you.
However they would certainly have the right to check what you claim at some point in the future, and they might expect you to provide some evidence and/or gather their own evidence.
If you're simply concerned about the practicalities of how you should determine whether you were in the UK at midnight, this doesn't seem to be clearly defined in RDR3. In another part of the document it talks about the point of disembarkation from a aircraft or train as being what matters for determining whether work is done overseas, but it's not clear if that also applies to the "midnight" test:
3.23 For journeys to the UK, the overseas work period ends when you
disembark from that aircraft, ship or train in the UK.
If you actually have enough edge cases for it to make a different to whether you meet the test or not, you might want to contact HMRC. Otherwise, just keep good enough records so that you can justify your claim to meet (or not meet) the test and you should be fine.