Rule 13.1c(2) says this about repairing damage on the putting green:
“A player may repair damage on the putting green without penalty by taking reasonable actions to restore the putting green as nearly as possible to its original condition”
You did this. Then when the ball wouldn’t stay they you deliberately took further actions to modify the surface to hold your ball there. In doing so, you breached Rule 8.2 interpretation 8.2b/1 gives the following example of a breach:
“Replacing or placing a ball when returning it to play by firmly pressing it into the surface of the ground to help prevent it from being moved by wind or gravity and plays the ball. Since the spot of a ball includes vertical distance, the ball is in a wrong place. As these related acts breach multiple Rules, the player only gets the general penalty. See Rule 1.3c(4) (Applying Penalties to Multiple Breaches).” Your action to further “repair” the pitch mark to recreate the depression is the same as pressing the ball into the ground.
So you were in breach of the Rules as above.
What you should have done per Rule 14.2e was try twice to replace the ball on the spot. Then you need to find the nearest place, not nearer the hole, where it will stay at rest that is either on the putting green or in the general area.
Note that the only time you’re going to move to a different area of the course under Rule 14.2e is when you are starting from the putting green. If, for example a ball in the general area won’t stay at rest you have to stay in the general area when doing this.