A clarifcation for something said in the OP. When you went to the wonders page and saw that the UN existed in two cities at the same time, look more closely and you'll see that in at least one of those cities it only says "Under construction". IMO it's weird that "under construction" wonders get listed there but that's just how it is.
And yes, the message that you can no longer continue building a wonder can come up a turn later than you'd want it to. I'm not sure why that happens but if you watch the event messages each turn you will always get the on time message that the wonder was built. In fact if you go and attempt to change the build order in that city you'll no longer be able to switch back to the wonder. It's weird and sort of buggy but it is at least avoidable. Just pay attention to wonder completion messages when you're in a wonder race (I think the messages are always in grey, to help spot them).
EDIT... Actually I reckon I could have a stab at guessing the reason why wonder build order changes come up a turn too late. Hammers always get applied to whatever you're building in your cities at the end of your turn, basically as you pressed the End turn button or press Enter. Let's suppose that at the end of turn 1 you put hammers towards the Pyramids. Also on turn 1 let's suppose an AI finishes that wonder. When turn 2 starts, the city you had building the Pyramids has not been checked for whether it can continue building because that check was performed at the end of turn 1 when it was still possible. Now you hit end turn to end turn 2 and as that city attempts to process the build order for the Pyramids, it can't and so it removes it from the build queue, turns the hammers into gold and you don't learn about it til the start of turn 3.
I hope I explained that well enough. In MP the situation is quite different of course.