There is a bug on the contrast checker and I'll try to describe the bug here with some visuals.
Imagine you have a fixed frame with a list of items that overflows that fixed frame, and those list items are for example a rectangular frame with a text inside it. The hierarchy would look like this:

The first two items correctly show the white foreground color within the contrast checker and also the correct background color (red)

but on the third item only the foreground color (white text) is correctly shown, the background color is shown as my canvas background color (303030), which is technically a background, but the wrong one. It should still be the red background of the frame

The color contrast checker should default back to the nearest hierarchy and take that element as the background. Right now it feels like it’s checking within the canvas what the background is and not within the hierarchy.