It's not mandatory to wipe data when upgrading android version but some bugs might appear. For example I have updated my mi9 from android 9 to 10 and it worked it's true, but some apps for example did FC and camera used to crash. Wiped everything and now with the same rom everything is perfect.