One possible reason I can think of is setting the session_replication_role to replica do some insert that violates the constraints and then set it back to orgin.
session_replication_role can disable triggers and rules, but primary keys will still be enforced.