We came across what looks like the same issue with another person a short while back.
How many records are in your found set of parent records at the moment this script is performed?
We discovered that the above script, which I've recommended to a number of users, will not work correctly unless the parent record being duplicated is either the last record in the found set or the only record.
We fixed the problem by making a few small changes to the script:
After Freeze Window, add this step:
Set Variable [$RecordNumber ; get ( RecordNumber ) ]
Then change the go to previous record step in line 6 above to:
Go To Record/Request/Previous [$RecordNumber ; no dialog ]
Finally change the go to next record near the end to:
Go To Record/Request/Previous [Last]
This assumes that the records in both layouts are Unsorted.