Which platform are you using UBPorts Installer?
If it's on Linux, try with USB2.0 port or USB 2.0 cable.
Or try UBPorts Installer on Windows.
For me, I have the same problem
stuck at "Asserting unlocked bootloader variable".
when reflashing Ubuntu Touch on my FP4 via UBPorts Installer on Ubuntu 20.04/22.04. But I'm pretty sure it used to be working when I flashing Ubuntu Touch first time. They must to be the update (maybe kernel, android-tools or fwupd describe here: https://unix.stackexchange.com/questions/684494/fastboot-recognizes-device-but-unable-to-flash-stuck-with-no-output-on-ubuntu/747584#747584) breaks it. After pinpoint down the problem, it seems to be stuck at fastboot
command. Since I have already tries different cable, usb ports, etc...
My solution? by using windows 10/11 to flash Ubuntu Touch via UBPorts Installer. After install the driver, it works out of the box.