How do you know that no PDF was saved? could it have been saved to an unexpected location? Try enabling the option to automatically open the PDF after saving as a test.
And there appears to be a misconception about go to layout that may or may not be part of the problem:
Go to Layout ["Print Layout" ; ( Table occurrence name here ) ]
While the file's name may be the same as a table in your file and this table likely has a table occurrence name all with the same name, what is specified in the parenthesis is the name of a table occurrence, a box in "Manage | Database | relationships that corresponds with the table occurrence specified in Layout Setup | Show Records From. You can have many different tables in your file and each such table can be represented by many different table occurrence boxes in your relationship graph.
In both of your scripts, if the layout you are on and the layout the script changes to are not based on the same exact table occurrence, your found set and current record may be completely different on the two layouts.
Phil, thanks for your response. When I run the script I specify the save location in the Save As PDF dialogue (I have not specified an output file path in the script). I do a search for the pdf document and it comes up empty. I tried selecting the 'Automatically open file' option and nothing happens--just returns me to the original layout. And yes, you're absolutely right about specifying the table name rather than the file name. In this case, the file currently has just one table, which has the same name as the file. Wonder if this would disappear if I upgraded to 14! :)
It shouldn't happen in 13. Many use 13 to do this with no trouble so it is not clear at this time why it is not working for you.