From the W3C spec:
The containing block is established by the nearest ancestor box that establishes an fixed positioning containing block, with the bounds of the containing block determined identically to the absolute positioning containing block.
Note: Properties that can cause a box to establish a fixed positioning containing block include transform, will-change, contain…
I have seen quite a few issues detailing this confusing behavior, with many people calling it a "bug" despite it being explicitly defined in the specification for years.
That said, I personally cannot imagine a specific use case where you would ever want this to happen, and it seems to completely contradict the entire point of what "fixed" position is supposed to mean. For all the discussion I have found on stackoverflow and elsewhere, I have not seen a single comment explaining why this is a specified behavior.
I know there are workarounds and I'm happy to implement them. It would just give me tremendous peace of mind to know what the intended purpose of this rule is. Does anyone know?