That has happened. At a competition in 2004, a friend of mine was competing in the Over 40+, and also in the Overall Light Heavyweights.
He placed second in the Over 40+ and this other guy was third, and later on, in the Light Heavyweights, placed 6th, and the other guy 5th. He was pretty confused on this too.
Spoke to one of the judges who said that in the hour and a half between the two, the other guy got a little better, at that moment and time.