It would be better to come up with an estimate of plausible ranges of screen brightnesses and a plausible range of surrounding contexts, and then use a real color appearance model to decide on visual contrast at the extremes of those plausible scenarios.
But whoever designed the WCAG guideline was either not an expert in human vision or perhaps thought that would be too complicated to use a model which more closely approximated perceptual responses.
The WCAG guideline should be seen as nothing more than a loose suggestion, with lots of false negatives. That is, if it says something is illegible, then it should probably be changed. but if it says the contrast is okay, then that should be checked by a better model (or human inspection).
Both white-on-medium-blue and black-on-medium-blue buttons are inaccessible and should be avoided if possible.
In isolation, for me, the white on blue, has contrast bleed which makes the text fuzzy.
Again, in isolation, the black on blue is much sharper.
Together however, when presented side-by-side, the black on blue feels to be lower contrast. It's almost like my brain is using the black on blue to help compensate the weakness of the white on blue.
I have no data about this. It seems plausible, but it feels unlikely according to my intuition. To me it seems more likely that their naive algorithm for contrast ratio (which is based on their formula for relative luminance) doesn't match human perception in some cases. Color perception is complicated.
https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-rat...
https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativelumi...