Brightness and color are connected, but not absolute.
The W3C suggested calculations make some assumptions and weight red, green, and blue color values differently in terms of brightness. (Blue being the darkest, and green the brightest.) These weights are only approximations and represent the colors at full saturation, so they may not perfectly represent the full color gamut one might encounter.
Some screens might show your orange color as brighter or darker, but the formula can only give it a single number for contrast calculations. For example, you couldn't use their formula for printed documents as "bright" colors like white won't glow the same way they do on digital screens.
Green is traditionally disproportionally bright on most screens, so it gets a higher weight. Since your orange has a lot of green in it, you can reduce it a tiny bit to pass AA without changing the color very much. You (and your users) might not even be able to see the difference.

You can find tons of colors that are nearly identical except one will mathematically pass the test but the other won't. It's mostly a side effect of taking a complex, multi-dimensional color space and simplifying down into a single number.
This is also a good example of how these are only guidelines rather than hard and fast rules. The main takeaway when your colors score low or only pass some of the tests isn't that there is a "right" or "wrong" pairing, it's that they are on the edge of being difficult to read, so you should consider different colors if contrast and legibility are your main concerns. It's up to you to decide how much value you place on design aesthetics vs. complying with guidelines.
W3C Color Contrast Formulas