What build of Pega Robotics are you using? There have been several changes in the PDF Connector since 19.1 was initially released and a later version may handle file switching better. I believe 19.1.27 added the ability to specifically "Open" a file rather than simply changing the FileName property.
I am using a later build and while I do not have your automation, I tested by getting the LineCount of a Document using the attached solution and it is working as I would expect it to. Perhaps you are not resetting the file, or it is not being closed between opening.