When a player's ball at rest moves after being touched by the player, a caddie, or equipment, but not by wind, water, or gravity — those carry no penalty at all under Rule 9.3. Rule 9.4 makes the default a one-stroke penalty with the ball replaced, but several everyday accidents are excepted: moving the ball while searching for or identifying it, while marking, lifting, or replacing it under a Rule, on the putting green, or in the teeing area before a stroke. A ball nudged off its tee peg by a practice swing, for instance, is replaced with no penalty; the same nudge to a ball already in play in the fairway costs one stroke.
Source: https://www.randa.org/en/rog/clarifications/rule-9, https://www.golfmonthly.com/golf-rules/yes-there-is-still-a-penalty-if-you-accidentally-move-your-own-golf-ball · high confidence