In normal times of course this should be possible, but at the moment I would not advise strategies relying on this.
And, at any time - all you need is an unhelpful or unfriendly agent who may refuse to check you in. This looks like dodgy behaviour, so you are definitely at risk of encountering some resistance.
You really should not be relying on things that could easily go wrong. Book in a better way!
(To the OP: you presumably meant "airport A" is XXX, and "airport B" is YYY - right? Unclear why you didn't stick with the single form of terminology!!!)