Okay we found out the problem. According to Apple's website:
Cached files are created when streaming or viewing content like music, videos, and photos. When you stream music or video, that content is stored as cached files on your iOS device so you can quickly access it again. iTunes categorizes cached music, videos, and photos as Other instead of actual songs, videos, or photos.
Your iOS device automatically removes cached files and temporary files when your device needs more space.
Try deleting some of this data. Also go to iTunes > File > Devices > Transfer Purchases from [device name]
This sometimes clears up storage for me.
If your iPhone doesn't start making some space I will suggest the following:
Make an encrypted iTunes back up. This backs up some extra data such as health data.
About encrypted backups in iTunes - Apple Support
Restore your iPhone with iTunes. What this does is reinstalls the latest iOS release. This can help and your situation. Erasing in settings does not do this.
Restore your iPhone, iPad or iPod touch to factory settings - Apple Support
Restore from backup.
Restore your iPhone, iPad, or iPod touch from a backup - Apple Support