While on the bus I checked google maps and discovered that I would get to Madrid far sooner by train .

The train was delayed by 35 mins. Would I make it before midnight?

Interestingly baggage get’s scanned before boarding.

Yes! Made it to Madrid before midnight local time. But not to the hotel. Better than 0330.