If you continue having trouble, let us know some things when you come back:
- What iOS does your phone use?
- Do you have “Optimize Storage” checked in Settings>Apps>Photos?
- Do you see all your iPhone pictures at your account at iCloud.com?
- Have you checked to see if the Apple Account is really really the same on the iPhone and at iCloud.com?
- What doesn't "not close to full" mean? What is your storage on this iPhone? At Settings>General>iPhone Storage, my phone says 50.5 GB of 128 GB used. What does yours say?
By "has just a few photos that were not backed up," do you mean synchronized with iCloud Photos? iCloud Backup is a different service. iCloud Photos is not a backup service.
Can you identify these few pictures? Were they taken on the phone, or were they transferred there? Can you edit them? Do they allow deletion? Can you save them to Files?
Do you have a backup of your Photos library? To back up your pictures you need to plug in an external drive, select the pictures, and use Share>Save to Files. Alternatively, you can backup to a computer:
Transfer photos and videos from your iPhone or iPad to your Mac or PC
If you haven't done one of those backups, then your remaining pictures continue to be in peril.