Pattern Matching with path dependent types confusing behavior

A comment on a similar question states that pattern matching uses the erased runtime class, which was my understanding, too, but if it just relied on the runtime class, why does the pattern match work differently on a.x vs b.x when those two objects have an identical runtime class? Help understanding local class definitions