The amount of time spent to debug the issue, I think would be best if you made a fresh OS and migrated your websites there.
Especially because if the initial installation failed, then probably you installed the script when a bug was unpatched, and the upgrade didn’t address it (like the PHPMyAdmin thing).
That was what most likely happened.
Regarding the fresh ubuntu, depends. Did you manually install it by iso or did you use your provider auto-installation? Because providers like contabo and oracle cloud are known to install their bloatware with “vanilla” installations.
That shouldn’t happen at providers like Hetzner.
P.S: I just read your provider is hostinger. I wish you good luck but I won’t touch that provider.