So... the layouts share a base table...? Are they different instances of the table or the same?
If I understand correctly, you might want to try changing the Instance for Window 2... So it always shows the selected record shown in Layout 1.
If when you selct a new record, a global is set to the id of the current selection, Window 2 could have a relationship instance as its base which shows the related current record. Your script might then only have to update the value of the global to the value of the current record's ID..
To quote the original message: "The two layouts point to different tables."
"Point to" is not clear.
You can have a layout which has as it's basis a table or an instance of a table. You can have related fields and portals on that layout.
You cannot have the same record in two different tables. You may have a related or a matching record in a different table but it won't be the same record.
The suggestion I recommended still applies. Whatever makes the data match the records in the separate table can be used to make the match for the relationship in Window 2.