Merge pull request #5818 from mamapanda/patch-3 merge: Check insert_head_ids error in create_virtual_base