This is an error due to the fact that cloud-init hasn't had enough time, on each try, to update some specifics. This happens if an OS is installed in a VM for under 10-15 minutes and then immediately replaced with another one, which ultimately renders the password tokens inacessible.
In order to correct the fault, wait 15 minutes and please install an OS from an entirely different family than the one you're using currently.
If, for example, your OS is Debian 12, you must install AlmaLinux, Fedora, any RHEL-based OS, for example. If, on the other hand, your OS is from the Red Hat tree family, you must install any Debian-based OS, for example.