Sometimes an error occurs during the initial firmware installation (e.g., a connection issue) and your Trezor device will display an "Unofficial firmware detected" message, since every device comes without pre-installed firmware. In such cases, your Trezor may register it as an attempt to install (malicious or unofficial) firmware.
If the device came from us and you want to reinstall the firmware, please wipe the device according to the manual:
The factory reset will wipe the device, including firmware. You can then proceed with a fresh setup.