I've always wondered bout this, but if you check your production it really doesn't do anything detrimental to your queue. Your city will always build one improvement even if that improvement is pass the list.
Same goes for the resource. If the resource is added to your queue it will always go down 1 turn no matter what position it occupies in the queue.
For example in my current game I'm building a soldier and I got a fire Shard in the queue after the soldier.
In my current turn it looks like this:
Soldier 7 turns Left, Fire shard 18 turns left.
When i pass the turn it looks like this:
Soldier 6 turns, Fire Shard 16 turns,
Which means that the fireshard is being built independently from my queue :>. (But yes I agree its quite annoying and confusing)