The package names would not be different if it’s installing a different (possibly malevolent) version of the same app.
Only the signature and other metadata would be different, but if the package name were different it would show as a different app entirely in places like f-droid, not as installed from elsewhere. It would show the intended app as not installed at all if the package name of the Xiaomi version wasn’t the same.