The position is only flipped to the right or left when the anchor is dragged outside the body. Without position: relative on the body, the containing block of the "tooltip" is the initial containing ...
The CSS Working Group just discussed [css-anchor-position-1] Which writing-mode does position-try-tactics operate on?, and agreed to the following: RESOLVED: use the containing block's writing mode, ...