There’s a little bit to untangle here, which I feel might be best in a separate answer.
When you enter Japan on a mid to long term visa (e.g. work visa or student visa), that visa is ticked off at your port of entry and you instead receive a resident card. Thereafter, the visa sticker is just a bit of colour in your passport; the residence card is what matters both to Japanese immigration control and to the airlines checking if they can let you board.
When you enter Japan as a citizen of a visa-free country, you get a landing sticker into your passport which effectively serves as an entry stamp. When you leave Japan, the immigration agent will search for that entry stamp and apply the corresponding exit stamp there.
When you leave Japan temporarily while your residence card is valid (i.e. the special re-entry permit system), you fill out a form on departure half of which is stapled to your passport and an exit stamp is placed next to it. When you return, the half that was stapled is removed and the (re)-entry stamp placed near the exit stamp.
(I haven’t yet tried what happens when one leaves Japan altogether at the end of one’s mid to long term visa period. I expect a reverse direction version of the first)
Thus, from the point of view of Japanese bureaucracy, these entries and exits always come in pairs but which pair you are eligible for depends on your status. You will want either an entry stamp as a short-stay visitor or a residence card and a re-entry permit on departure and you will want either a passport of a visa-free country or an existing re-entry permit and exit stamp on return.
Your residence card only states nationality A
Now as long as your residence card doesn’t denote your nationality B, you cannot exit under the re-entry permit system using passport B, as the citizen on your residence card has nationality A. Likewise, if you present passport B as if you were a short-term visa-free visitor, the immigration agent will notice that there is no corresponding entry stamp and that will lead to problems.
It doesn’t stop there. Assume you somehow got out using passport B; what happens when you go back? Every single time I checked in for my flights back to Japan as a mid to long term resident, I was asked for a confirmed onward trip or a residence card. (In fact, when checking in for the outbound leg, the airlines already wanted to see my residence card in addition to my passport.) It probably won’t create an issue at the border itself, as short-term visitors tend to get waved through pretty quickly (my European nationality may bias me here) but then you suddenly have an entry stamp without a corresponding exit stamp in passport B which will probably cause you issues after your residence if you visit again on passport B.
tl;dr: it may work, but it’s most certainly not worth trying and explaining all the shenanigans.
Your residence card states nationalities A and B
You describe this in your follow-up to your own answer and in the comments as a surprisingly easy process. Once the residence card states both nationalities, you can present any passport on exit and/or re-entry. I would strongly believe that the immigration officer on re-entry would like to see the same passport you exited with (see above, passport stamps and the stapled form) but it might even be possible to exit and reenter using the two different passports.
As I mention above, the visa sticker is pretty much irrelevant once you’re inside and it’s ticked off so passport B or a renewed passport A not having it don’t matter.
tl;dr: Go for this solution if the need arises.