Coming indoors often ends the fun outside. If your dog has learned that returning brings a treat, that can be useful information, not a bad habit. The question is whether they can return safely when you need them, and whether the yard is secure while you practise.
Make returns worth repeating
Call once from a place where your dog can respond. Reward coming over and, when safe, sometimes let them return to the yard. Practise when you do not urgently need to leave. Keep a predictable reward just inside the door and avoid grabbing their collar or shutting them away as a surprise every time. If they ignore the cue, make the next practice easier rather than calling repeatedly from farther away.
If the yard is not reliably secure or your dog might run out through an open gate, use a safe lead and supervise them. Never leave a dog outside in unsafe weather to wait them out. If refusal is sudden, or they seem frightened of the doorway or uncomfortable walking, check with your vet before treating it as a recall problem.
For a broader plan across settings, see the recall training guide. The treat is not the problem. It is a reward for a return that you want to keep reliable.
Today, call your dog in once at an easy moment, reward them, then let them go back out if the yard is safe. That small repetition changes what coming inside predicts.
Sources: Dogs Trust on rewarding recall and building in easy settings. VCA on fear of places when a dog refuses to move.