This is part of Google Fast Pair's design. When you rename the Xiaomi Buds 5 on your phone, the new name is stored locally on your device rather than on the earbuds themselves. If the pairing is canceled or the earbuds are unpaired, the connection will reset, causing the name to revert to the default.
To maintain the custom name, you need to rename the earbuds each time when you reconnect them.