A simpler solution, avoiding the additional search of the primary cursor,
clear/restore the overwrite flag before/after the initial insert, and use
the error from the primary insert call as before.