This reminds me of a quick in Kings Quest, which let you walk across the water to the island by ducking while slipping down the embankment. Apparently you couldn't duck and drown at the same time.
As well as Shinning Force, Breath of Fire, Phantasy Star, and Illusion of Gaia.
And I'll second the Octopath Traveler recommendation!
But, what if both the players and the monsters both had Wall active? That situation would have an infinite recursion problem. The solution for the game was to say that a spell could only bounce once. That solution led naturally to monsters that always had Wall up and would cast a lot of spells so that you could defeat them by using Wall on yourself.
The only way to win is to die and get a game over screen. THEN use a revival pill!
Edit: mate said "Most likely FF Mystic Quest. Heal 2 different bone skeletons to kill."