I think that when a cat is in the habit of entering people’s houses and when it’s entered the wrong one the OP is considering resorting to committing criminal damage, and people seem to think the neighbours should be totally ok with their windows having been smashed, to get it out it’s not unreasonable to tell her that if her cat is going t end up in these kinds of situations she needs to keep it in or cat proof her garden to stop it happening again.
Cats roam, I’ve owned cats myself. But anyone who owns a cat needs to realise that the ability to wander sometimes comes at a price. Cats being hit by cars, cats wandering too far from home, and in this instance,cats being shut in houses without the ability to get out.
yes it’s stressful but if you want to be a cat owner you need to accept that that means your cat may get into situations which it can’t get out of. And if you don’t want that then you need to keep it inside.