late to this party but this seems to me like a classic issue with multiple valid forks on the network, you appended block to a fork that was later discarded.
This is being caused by pools that run multiple BPs in parallel, where each BP creates a valid, but different block. Then these 2 different chains are propagated through network, and shorter chain is later discarded. You were a victim of their negligence. This was mentioned recently on many places, including reddit and twitter. Here are some posts where pools that are malicious in this way were detected: https://twitter.com/SmaugPool/status/1469602098090323977/photo/1