Source would be me. I've ran into this problem... yes, it was very complex systems, but it did run into race conditions using mysql_insert_id. Now, why did it happen, I'm unsure, but it was solved by using transactions. Transactions are nice as you can rollback the WHOLE thing if something barfs, ie. nothing happens.
It's probably safe on simple inserts to just rely on mysql_insert_id, but I tend to err on the side of caution.