Wallets are encrypted with a key derived from a password. Hardware wallets use a hex-encoded public key generated by the device on a special derivation path as the password.
With the recent refactorings, Xpub.get_pubkey_from_xpub now returns bytes, so we need to explicitely convert it to a hex string before passing it to storage.decrypt.
Note that this was already fixed in HardwareKeyStore.get_password_for_storage_encryption which is called when the wallet is first created, so any wallet created by Electrum ABC 5.2.8 will be correctly encrypted. The bug affect the decryption when the user tries to reopen the wallet later.