I often see something like the above when playing chess online. When I played Ruy Lopez and my opponent played Classical Variation, but I transposed us to Four Knights Game Spanish Variation, I had castled in between the Classical move and the transposition (Move 4).
It seems the reason the opening name says "5. O-O" because it one of the openings where the order of moves doesn't matter. But is this a bug in chess.com or intentional for the opening name to be mismatched with the move numbers?