Hello Blubber Bear,
Your i-device was not designed for unique storage of your media. It is not a backup device and media transfer was planned with you maintaining a master copy of your media on a computer which is itself independently backed up against loss. To use a device with a different setup you transfer the old library from a computer or a backup directly to the new setup, not the device to the library. Media syncing is one way, computer to device, updating the device content to the content on the computer, not updating or restoring content on a computer from a device. The exceptions are iTunes Store media purchases which can be transferred to a computer.
Transfer iTunes Store purchases to your Mac [Mojave version] - This feature works only for media content (not apps) bought from the iTunes Store https://support.apple.com/guide/itunes/transfer-purchases-from-a-mobile-device-itns255b2767/mac
Alternatively: Redownload apps, music, movies, TV shows, and books from the iTunes Store, iBooks Store, and App Store - https://support.apple.com/HT201272
I suspect this is what Apple intends for you to do instead of transferring purchases but if something is no longer in the store it is lost whereas transferring purchases from a device means you will still have it. :-(
Explore third party commercial software for transferring other items from an i-device to a computer. See this document by turingtest2: Recovering your iTunes library from your iPod or iOS device - https://discussions.apple.com/docs/DOC-3991 Even this method may not fully recover what you had in the library originally. For example if in order to save space when syncing you had converted music files to a lower bitrate, or photos to a lower resolution, it is those lower quality files you will recover.
If you subscribe to Apple Music, Apple Music tracks cannot be transferred from a device and have to be downloaded directly from iCloud. However, tracks which you had on CD can probably be downloaded from iCloud if you subscribe to Apple Music or Match.
For other items see: Transfer photos and videos from your iPhone, iPad, or iPod touch - Apple Support - https://support.apple.com/HT201302 - these are ones you have taken yourself.
Recover your iTunes library from your iPod or iOS device - https://discussions.apple.com/docs/DOC-3991