Well considering Flaming Sphere isn’t supposed to be making attack rolls at all, I’m not super surprised the implementation is a bit mangled.
From the 5E SRD:
Any creature that ends its turn within 5 feet of the sphere must make a Dexterity saving throw. The creature takes 2d6 fire damage on a failed save, or half as much damage on a successful one. As a bonus action, you can move the sphere up to 30 feet. If you ram the sphere into a creature, that creature must make the saving throw against the sphere’s damage, and the sphere stops moving this turn.