Our post-save hooks and donation queue consumers often try to insert a series of rows: contact -> contribution -> contribution custom data, for example.
Sometimes when one of the first steps is rolled back, the code continues trying to insert the child rows with now-non-existent parent row IDs and causes foreign key constraint violations. We did some work to try to prevent this in T192977, but we're still seeing these FK violations in failmail from time to time.