Hi there marei611,
Thank you for posting to Apple Support Communities.
We understand your AirPods Max are not working when connected to your iPhone. Is that correct?
We're happy to help. Make sure your iPhone is up-to-date with the latest iOS software. Before updating, we recommend backing up your iPhone first. These articles can be of help. When you back up, you can back up using a Mac or PC rather than iCloud if you choose.
How to back up your iPhone, iPad, and iPod touch
Update iOS on iPhone
Then, test if the issue continues. If it does, reset the AirPods Max. See "Return AirPods to factory settings" here: Unpair, restart, or reset your AirPods - Apple Support
If you continue to have issue, we recommend contacting Apple Support: Get Support
Take care.