Changing the type there is a hardfork. Also not a good approach (makes more sense to just allow it to wrap around).
Defining a hardfork goes beyond writing tests. A test should simply confirm such blocks are invalid.
Well a approach could be that you first implement this type change in a patch and distribute it but just not activate it yet. You just set a block-id when this update should be active. That its enough time to let the hole network been updated. You basicly keep using for the old blocks the old uint32_t type. But new blocks will be uint64_t after that.
Only requirement is that enough nodes in the network has to get the latest updated. Because this bug has a long time to trigger you can delay to active this feature/fix for really long time. Like you know that every node has the update over the next view years (say 2030). Also you have a lot of time to distribute this knowledge to the community like this.