Invisible fences do not always work. I’ve known two dogs (a Boxer and a Pit mix) who, if they wanted out badly enough, would simply charge through and take the hit. Another (a Border Collie, natch) would get close enough to the “fence” to get the collar to continuously beep but not actually deliver a shock. After the battery ran down (and the beeping stopped), she would simply walk through the “fence.”
Smartie.