You are set since Apple only uses the passphrase to help generate entropy on the actual key that's used to unlock the data. Apple wrote a very clear white paper that covers the protections and goes into some technical detail.
If you set up a device with the same passcode 5 times in a row - none of the keys would be the same and no one could get at the data from the device even if you told them your passcode.
You are correct - they key is destroyed instantaneously and the data is cryptographically erased. You don't need any special tool to overwrite any of the data since it was previously encrypted and that encryption exists at rest. When you erase the device, the key that unlocks the data was destroyed and no passphrase will get that key back since it never left the Secure Enclave.
iCloud is more complicated, since your data lives in Apple’s servers and can be seen on the web, via API on official and unofficial apps, on Windows and on macOS and other devices in addition to your phone.
The encryption keys used to encrypt this data when it leaves your device are not the same keys as the ones used to lock the files at rest on the iPhone hardware.
So, you buy a new phone and take a picture of your pet. That pet photo is encrypted at rest with a key that’s entangled with your device passphrase, not actually encrypted with that passphrase alone.
Now - when you sign up for an AppleID or iCloud account - a different password generates a different set of key pairs both in the cloud and on device. Now things are much more complicated than just a device encrypting data at rest, since we have multiple key pairs and signing certificates and multiple computers involved just to get data to iCloud from your phone.
The process to sync the data to the cloud doesn’t need to know how to decrypt the data from storage to show it to you or send it to the cloud since iOS and iPhone hardware handle that encryption transparently to the apps. The running OS isn’t necessarily aware the data is encrypted like a fish doesn’t need to know it’s in the water to swim.
A different encryption is added before that data backs up or syncs to iCloud servers. In the case with the wiped device, when you sign in to iCloud, new key pairs are generated from that sign in event and used to decrypt the pet photo that comes down from the iCloud backup to your wiped phone (or new phone). The iCloud “app” decrypts the data and then the iOS stores it using the new local encryption key from the Secure Enclave (since your passphrase unlocked the device). Once sync is done and the file written to local storage, it is encrypted at rest with a different key than the key used to encrypt the data when it moved to cloud from old device and back to the new device from the cloud.
To wrap up, the pet photo can be encrypted many times, using different keys based on where it’s heading. The same file gets transformed (in a reversible manner) so that when it’s decrypted, the data is the same file so it looks to us like your pet each time we look at that photo.
The hardware encryption is different than the software decryption and pulling this off in a way that people can use and not make mistakes in security is a very hard problem to solve.