It's not a bug — it's your database refusing to let the wrong person write a row. Why the error shows up the moment security is on, and the right…
The short answer
Aliteq
Your app says "new row violates row-level security policy". Here's what it's protecting.