the problem is that you are using any form post for the trigger.
since you are using 2 form on the same page, you will 2 sets of the insert record behavior.
one set for the 1st tab - insert new contact & case the inserts for the contact and case tables should use the submit button for the form on the first tab as the trigger.
the second set for the 2nd tab - insert existing contact & case. these inserts will use the submit button for the second form as the trigger.