Not knowing what database are you using, I can tell that Oracle has a limit on recursive calls in a trigger, and moreover, it does not let you modify objects that are “mutating”.
From the documentation:
“A mutating table is a table that is currently being modified by an UPDATE, DELETE, or INSERT statement, or a table that might be updated by the effects of a DELETE CASCADE constraint.
The session that issued the triggering statement cannot query or modify a mutating table. This restriction prevents a trigger from seeing an inconsistent set of data.”