A Child stream would reference the same version of the parent stream when it has foundation baselines created on the parent stream, and simply rebased on the child stream.
In that case, there is no point of running your script on that specific branch, as it would always reflect versions created on its parent.
I see the issue now after stepping into my script. My script is run against the dynamic view.
The dynamic view is holding on to the element versions from the integration while the snapshot view on the same stream is properly updated and showing the latest version of the same elements.
I thought the dynamic view is updated on the fly and will always have the latest content.
In fact:
The dynamic view was incorrectly setup.
I just created a brand new view and it's working as expected