I think I read this in the 1990s as part of a short story collection, but unfortunately, I don't remember anything about the rest of the book. The protagonist is a golfer, an extremely good one, and he wants to marry a girl. Somehow, he's gotten into a situation where if he wins a particular tournament, he gets to marry her. It may have been something set up by her father, with the agreement being that if he loses, he'd stay away forever. He expects to wind handily, but he finds that there's another player on the course who hits the ball perfectly every time. Somehow, he discovers that this golfer is the product of the girl's father, I think bought rather than created himself, and is a robot programmed to always strike the ball with the precise force necessary for a perfect shot. It looks like the protagonist is going to lose, but then he goes to visit the other player, and after they talk, the robot is consistently over-shooting every time, leading to the protagonist winning.
Earlier in the story, a salesman was trying to sell the protagonist a new sort of golf ball that was guaranteed to add 10 feet to his shot. The protagonist substituted those balls for the ones the robot was using. As it was hardwired to always product exactly the right amount of force, it was always going 10 feet too far.
I was watching this video, which reminded me of the story in question (which gives you a bit of a hint to the twist, admittedly).