They're not even in the same ballpark - the PS5 is more than an order of magnitude better in GPU performance.
Despite how much it does matter, RAM is not the only thing you need for running LLMs - that N150 is not going to run anything but really tiny models at any sort of reasonable speed - certainly nothing that approaches using all of its ram. The GPU in the PS5 is ~25x faster. And if you're running games the RAM doesn't really affect performance at all once you have "enough" for a given game.
You're right that you probably could build something quite a bit faster than a PS5 for the same price though - if you can build/find everything but the GPU for ~250 USD and slap a 16gb 9060xt (~25tflops @32bit compared to the PS5 gpus ~10tflops @32bit) in it for another ~350 USD it should theoretically do a better job - the GPU in the PS5 was on par with mid-high end PC GPUs on launch, but that was like 5 years ago.
[1] https://www.amazon.com/dp/B0GGM6BKN9 [2] https://www.amazon.com/dp/B0FX2TV3HX
Shameless plug - I methodically rank the best possible Mini PC deals on https://MiniPCs.zip for this exact purpose.