I don’t know if this will help. I also have two Apple IDs, from a long time ago. I do not have a brand new device, so this may not apply. I have one of them registered for iCloud, the other for purchases. It used to be possible to login to these as two separate things.
When I updated to the latest OS on my desktop, it wouldn’t accept that. I had to open the media account separately as a reboot on my desktop with the other account as being registered. I then entered the iCloud account into family sharing. Voila! That worked.
My phone still accepts two accounts. It is an iPhone 14. I don’t know if this will be true when I get a new iPhone. I expect that ultimately I will have to consolidate the two accounts. I think that will require calling Apple support, as login trickery is involved.
Hope this helps.