Sure fire fix.
Fill the tub with about 6-8 inches of water. Less if it's a kitten. Close the shower curtain
completely. Put the bottom of the shower curtain in the tub.
Make it as dark in the bathroom as you can, when nobody is in there.
When the trap gets "sprung", the racket will be tremendous. Especially if it happens at night. But it won't happen more than once.
It was dark when my cat sprung it. As soon as I turned on the light, and pulled back the shower curtain, the cat literally flew out of the tub, and the bathroom. But it never tried a second time.
[This message has been edited by Raydar (edited 11-20-2021).]