For most of the visit, your dog checks in happily. When it is time to leave, they dodge your hand and make another lap. They may have learned that a return near the gate ends the best part of the day.
Until they can return reliably, use a suitable long line attached to a well-fitting harness in a safe open area, away from traffic and other users it could tangle. Follow park rules. Do not unclip them in a place where you cannot safely regain control. If they are loose now, avoid chasing, move away cheerfully, offer a reward, and get help from a local professional if needed to bring them back safely.
Make recall less predictable
Practice calling your dog at home and in a secure area, rewarding generously. On a park visit, call them at easy moments, reward, clip the lead briefly, and then sometimes release them for more safe exploration. This makes the clip itself less certain to mean "we are going home." Practice collar or harness touch separately so reaching toward the attachment is not a warning.
Before the final departure, give your dog an easy reason to come near you: a familiar cue, a favorite reward, and a calm approach rather than a sudden grab. If the park is too exciting for them to respond, choose a quieter setting while the skill grows. A recall that works in the kitchen is not automatically ready for the busiest day at the park.
Leaving should be safe and uneventful. The best practice may be the three happy returns that happened before you needed the fourth one. For more on making a return worth repeating, see the recall training guide, use a safe lead backup until returns work in that setting
Sources: Dogs Trust Dog School: How to teach a dog recall. Dogs Trust: How to stop your dog escaping or running away.