Back when I was still green to this whole DM’ing thing and I had a few more players that were clever casters, this was something that happened all the time. They would find themselves faced with imminent danger and tap on the Cleric for Sanctuary which would more or less give them a free pass to turn the odds in their favor without being messed with. Eventually I cracked down on the practice of using Sanctuary as a method to setup a fight, or bypass one entirely by calling out player/party intent as a caveat to success of the spell. Eventually it came down to this particular wording.
Sanctuary will immediately fail if any of the affected members attempts a hostile, or perceived hostile action. This includes setting traps, stealing items, sabotage, subterfuge, and many other words that begin with “S” that generally means “up to no good”. Sanctuary is not a means to circumvent or favorably stage a challenge, it’s a prayer to hope you’re able to get somewhere safe and survive long enough to attempt a challenge a second time.