I've had 9mm carbines that grouped quite well even out to 100 yards.

If it's grouping well at seven and fifteen yards I don't see a logical reason it shouldn't group well at twenty-five.

Like already mentioned, the dot on your optic obscuring your target is my best guess as to what is causing your issue.

That or using better support and focusing on your technique might help too.