Console margins are really low. It doesn't have much operational overhead, but the gross margin is very low. AMD is able to make this a winning venture thanks to it really being semi-custom designs (rather than fully custom) so they can re-use a lot of existing (or already in development) IP. Additionally, the console makers help with the R&D expenses. So, AMD doesn't have to spend much to develop the chips (relatively speaking) and there's little overhead costs once the designs are finished. On the flip side, they make very little profit per chip. So it's low cost, low margin, but also basically guaranteed volume (and thus steady income) across multiple years with little risk to AMD.
All this to say, as console sales shrink and GPUs become a larger piece of the revenue in the quarter, margins go up because GPUs are a higher margin business than console chips (especially during the Lisa Su era). They have more ongoing operating costs, but the gross margins are much higher and are typically high enough to more than offset the higher operating costs. Thus, the higher the GPU to console sales ratio is, the higher the gross margin for the gaming category. Combine that with the fact that there are typically increased costs around the launch of new products (RDNA3 was still in it's launch window Q123) and you can get to roughly flat operating costs Y/Y.