Hello doug from stratford upon avon.
Welcome to Apple Support Communities. I understand that your messages are not syncing across all devices although you have enabled messages in iCloud. You have deleted some messages from your iPhone, but they still appear on your iPad and iMac. You have turned off messages in iCloud and turned them back on with no issue resolution. I’m happy to help.
Please restart all of your devices. Once they have all fully restarted, do the messages sync across all of your devices? If not, please make sure you have completed the steps in the section titled “Before you begin” here: Keep all your messages in iCloud - Apple Support
Take care.