I think you may need to add a 'Commit Record' step at the end of your script, so as to save the record, before you try to view it in the portal.
Perhaps the records you can see are the previous ones, the latest does not show, because it hasn't yet been saved.
Best wishes - Alan Stirling, London UK.
+44 (0) 20 7724 2456 - firstname.lastname@example.org - www.ast.fm.
FileMaker Certified Developer for versions 7, 8, 9, 10, 11 and 12.
I added the Commit Record to the script and still have this mystery ghost record hanging. I am for sure that the records that I am seeing are not previous records as I have dumped all records from the table and start fresh each test.
Check in your relational graph on that portal-to-parent relationship and see if 'Allow Creation' has been checked on the child (portal) side.