Strange Bug with Duplicating Server Connect Scripts

If I have something simple like a standard query and i duplicate it, it seems fine, however if I have a query with a condition, and i duplicate the entire script, then the query does not work.

I tried my best to explain this but I think the json files will be easier to look at

Original script view_accommodation_detail.php,
Duplicated script view_activities_detail.php,
all occurrences of accommodation should have changed to activities
all occurrences of accom should have changed to act

line 88 “accommodation_inner_tbl” (New File line 76 hasn’t changed)
line 89 “accom_inner_parent_id” (New File line 77 hasn’t changed)
297 “accom_inner_ss_parent_id” (New File line 155 hasn’t changed)
line 306 “accom_inner_ss_parent_id” (New File line 164 hasn’t changed)

I think this happens when I delete the table and insert a new table, and it auto removes the condition from the old table.
If i manually remove the condition, then remove the table, and then add the new table and new condition it works as expected.

Server Connect Scripts.zip (4.3 KB)