My understanding of why one would use iCloud for Messages is that it will help you with syncing your devices.
ie, if you have an iPhone and an iPad and you want them to display all the same messages. Even if you sell your iPad and buy a new one, when you turn on Messages in iCloud on the new iPad, all your old message history would load/be available.
It can also be helpful if your phone takes a crap and you didn't have any backups. Replacement device could be signed in, turn on Messages in iCloud, voila, all your messages show up.
If all you have is an iPhone, then using iCloud might not be the best solution for you.
--> As long as you make sure you back up your device regularly 😁
So the reason you cannot recover your messages in your situation now.. is because you were using iCloud to sync your messages, and when you delete a message on one device, it would delete the message across all devices