How to make AnchoredPosition update after pivot of RectTransform is changed?

I am changing the pivot of a RectTransform at runtime and want to take the new anchoredPosition that results from this change and use it for tweening.

However the value I get from panel.anchoredPosition.y is still the old anchoredpos. I tried waiting for 1-2 frames before asking for the value, I tried panel.ForceUpdateRectTransforms(), no result.

How can I fix this?