Detective story of uncovering the reason behind a strange dark mode bug, with a helpful summary for anyone