Please check my understanding is correct.
Step 1. you run the stored procedure. (select records from several underlying tables)
Step 2. you make changes to the underlying tables.
Step 3. you close, and reopen the stored procedure. But this does not reflect the changes to the underlying tables done at step 2.
If my understandings are correct, one possibility is that you may be using different transactions between (Step 1 and 3) and Step 2. Even though you are using one transaction (in Lazarus application), they are separate transactions if run on separate applications.
Important thing is you have to commit all transactions after step 2, and then restart transaction before step 3.