The issue here is the scrollx and scrolly
By changing the paralex of the layer scrollx and scrolly are not related to the layer anymore.
I think your setup would work if you change scrollx with (viewportleft(0)/2) and scrolly with (viewportbottom(0)/2)
the (0) behind the viewportleft determines the position on layer 0 that is in the middle of the viewport, so it should also work if the layer uses different paralex.