The tool doesn't rotate your photos, much less only some of them.
The tool takes the rotation from the photo's EXIF data. If there isn't an entry for the rotation, the field in the resulting feature class will have the value 9999. Wrongly rotated photos result from wrong entries in the EXIF data.
What you can try:
- If you take your photos with a phone, calibrate the phone's compass.
- Check the phone's direction in a map app.
- In my experience, yo'll have to go through the photos and correct at least some of them. The rotation angle is in the field "Direction". It's a geographic angle (North = 0°, East = 90°).
Have a great day!
Johannes