Is there a way I can take pictures and videos out of iCloud without losing metadata?
If you have Photos set to keep the originals on your Mac you already should have everything in your Photos library. Nevertheless syncing may fail sometimes so to be on the safe side you can request the content of your iCloud library directly from Apple:


Go to https://privacy.apple.com/
Log in with the Apple ID used for iCloud
Select the option to request a copy of your data
Scroll down to request your photos (and other iCloud content if applicable)
You can select the size of the ZIP files Apple creates. As you will have to select each file individually afterwards, go with the largest size (if your Internet connection is stable)


It will take up to seven days for Apple to prepare your downloads, you will get a mail with a link.