Mac external displays are now in the wrong order
I've found one solution to this: reseting my mac's NVRAM. This seems to reset the order of my monitors to how it was before. However, if I leave my Thunderbolt 3 display connected while booting my mac, the problem will come back again.

I'll wait a while before marking my own answer as the accepted solution to this question since a) it's not a particularly good solution, and b) I'd like to give other people a chance to post a better one.