In your original post you you wrote
"I currently have 3 different sets of photo libraries which I would like to merge and have them all backed up to the iCloud.
I have several thousand photos on my iPhone and these are also backed up to the iCloud already."
I am not sure how you have been using iCloud to backup the photos on your devices, as iCloud Photos is not a full backup of your photos. The photos in iCloud will be your working copy, so they cannot double as a backup. A backup should be a safety copy, that we never touch. iCloud Photos is just making it harder to back up our photos up properly, as it is an offsite storage and we need to download the photos to back them up.
Your photos will be backed up by iCloud, if you enable iCloud backup in the Settings > Your Name iCloud > Backup. Then your photos will be saved as a part of the iCloud backup of your iPhone or iPad. But this iCloud backup does not include the photos from your iCloud Photos Library. As soon as we enable iCloud Photos we disable the iCloud backup for our photos and videos. And also the photos you have synced from a computer to the iPhone or iPad will not be included in the iCloud backup of your device.
I suspect that some of your photos on the iPad or iPhone have been synced manually to the devices, either with iTunes or from the Finder. This would explain the warning, that thousands of photos will be deleted, when you try to turn on iCloud Photos. Turning on iCloud Photos will erase all synced items, as the manual syncing is not compatible with iCloud Photos.You should backup the synced photos directly on the computer where you have synced them from. Manual syncing selected albums is only one way and it is a lot of work to get these photos back from the iPhone or iPad to a computer. and the synced photos will have been synced in a reduced quality any way, scaled down for viewing on a device with a smaller display.
Another possible reason for the warning about "Photos will be removed" could be, that you have saved incomplete copies of Photos Libraries that have been previously been syncing with iCloud. The local copy of a Photos Library will be incomplete, if a library has been syncing with iCloud Photos and you have been using the option "Optimize Mac Storage". With "Optimize Mac Storage" enabled your library will no longer contain all image files, as some of the high resolution originals will have been removed and need downloading from iCloud.
If you want to use iCloud Photos on all devices to have all photos in sync on all devices, you need to merge all libraries into one library, as only one library on your Mac can sync with iCloud Photos. When you sync several Photos Libraries on your Mac with iCloud in turn, the libraries will be merged in iCloud. iCloud Photos will check for duplicates, when you switch between Libraries.
To upload all your Photos Libraries in iCloud Photos, make each of them in turn your System Photos Library and then enable iCloud Photos for this library and wait for the upload to complete, then merge the next library into iCloud. This will probably take several weeks, as the syncing and merging takes a long time. It is not just an upload - the merged library will sync back to your currently open Photos Library. All your libraries will be modified, so make backup copies of them on an external drive, before you start the syncing.
To be able to have a backup of your merged Photos Library, once all photos are in iCloud, avoid the "Optimize Mac Storage" on your Mac. Then the local copy of your Photos Library will be complete, including the precious high resolution originals" and you can use Time Machine to backup your photos and videos. Otherwise the only copy of your photos will be in iCloud, and you will need to be very careful never to delete accidentally any photos or videos from any of your devices. The item will immediately be deleted fro iCloud and all your other devices syncing with iCloud Photos and the Recently Deleted album will be your only safety line to recover accidentally deleted photos. It is essential to have at least one complete local copy of your Photos Library on a computer, that you can regularly back up, so you can recover deleted or damaged photos.