Are you using "Optimise Mac Storage" for iCloud Photos? If not, you can copy your Photos Library directly to an external volume, where you can set the "Ignore Ownership on this volume" flag. This flag is essential to avoid problems with the file ownership, when you try to access the copy of the library from a different user account. And the flag can only be set on a volume, where no system software is installed.
The external volume should be prepared as described here: Move your Photos library to save space on your Mac - Apple Support
Once the copy of the library is on the external volume, you can sign into your second user account and double click the library to open it in Photos. If that is working, sign into iCloud with your second AppleID and enable iCloud Photos for this copy to upload it into iCloud.
If your Photos Library has been using iCloud Photos because of lack of storage on your Mac, you will first have to ensure that the library will be downloaded from iCloud to the copy of your library, as it will be incomplete.
While signed into your current user account,
- quit Photos, if it is running.
- Open the copy of the library on your external volume in Photos by double clicking the library.
- Now make the copy your System photos Library in the Photos > Preferences > General: Click "Use as System Photos Library".
- Make this copy your iCloud Photos Library in Photos > Preferences > iCloud. Click "iCloud Photos".
- Also set the checkmark for "Download Originals".
- Now wait for all originals to download into the copy of the library.
Once the copy of your library is complete, you can proceed as described above to use the library from your second user account and upload it with the different AppleID.