Need help with multi-insert data for duplicating DB tables

Hello Guys,
I need your help in inserting/ replicating data into the same tables. I tried multi-insert which works when there is 1:1 record to be inserted. When there is 1:many data, I am unable to get the data inserted. I have given brief about the tables i have created & also explained the approaches i have followed till now.

There are 3 tables of which 2 are sub-tables:

 institute (PK: instituteID)
       contacts (sub- table PK: contactID , FK: institute_id)
       rooms (sub- table PK: roomID , FK: institute_id)

The contacts table has 1:1 records while rooms table has 1:many records with institute table.



There are 2 approaches I have followed:
First Approach: This is the server action:

This server action inserts data into the institute
& contacts table without any issue as shown in below image highlighted with GREEN color.

However, the data in rooms table is repeated for as many instituteID are there in the institute table. In this case, there are 2 institute details & hence it inserts first 2 rows data highlighted in RED color.

Second Approach: This is the server action:

Here too, the server action inserts data into the institute
& contacts table without any issue as shown in below image highlighted with GREEN color.

However, the data in rooms table is repeated twice for instituteID=1 and new institute_id = 23 & 24 is assigned to the repeated data, while the data for instituteID=2 is not inserted.