The WCAG calculations for contrast are complete rubbish, in my experience they don't reflect reality very well at all. I haven't been able to figure out why though, each of the individual steps looks reasonable.
The main issue is that they linearise the sRGB colour space before adding together the components… and then never 'delinearise' it afterwards. Human brightness perception is non-linear and WCAG totally ignores it.
This is a collection of 'even' black-white gradients in different colour spaces.
https://docs.krita.org/en/_images/trc_gray_gradients.svg
LAB is pretty much the standard for a perceptually even colour space.
The sRGB gamma curve was chosen based on CRT mechanics… but it’s pretty close.
The WCAG calculations only make sense in a world where 'Linear TRC' is perceptually even.