I've had this happen to me as I played Demon's Souls. I had my external HD from my PS4 hooked up and it was downloading a bunch of updates when what you described happened. Had to manually turn off and turn back on the PS5 by pressing the front button. PS5 then proceeded to rebuild it's database...