It’s a normal physical phenomenon.
It depends on many things like the optical scheme of lenses, so that, on certain angles, rays of light enter without reaching the sensor directly and green dots and reflection appears. Trying to avoid this, lens hood are used on professional camera. Lens can have also treatment like coating. Or you can try to change angle. Many users have noticed that on iPhone this phenomenon is more evident. You can see it on internet or examples on youtube. I have also experienced this when I moved to iPhone 13 pro max from Note 20 Ultra or using my Fuji X-T3 , which have flares but not so many. Other, on this community, say that iPhone is equal or better than other about camera. Is it true? There are no Apple’s engineers here to solve things can’t be solved. Unfortunately the only choice is to accept your iPhone or return it back. Personally, I have choose to accept it because I love it for other reasons. I wish Happy New Year to all of you. bye