

systemd will try to save any kernel panics in pstore via systemd-pstore, if it’s enabled in your kernel. I’d check /var/lib/systemd/pstore and see if anything in there on the next boot.
Can you elaborate on ping “running”? Do you get actual icmp replies coming back? Because there’s no code path I can imagine where a ping would cause hdd activity (on a normally running system).
If ssh times out (and you don’t do anything fancy with the firewall), then it’s not sshd dead, it’s sshd not being able to respond. Grab a tcpdump for dst port 22 from your local machine while RPi is stuck and see if you get any replies whatsoever or it’s just retransmits going into the void.
My first rough suspicion would be ram abuse. Something eats up all ram and the system locks up and semi-dies. Pstore would have OOMs. You could run a local script for telemetry recording too to see if ram use spikes up before the system gets unresponsive.
I actually don’t remember off the top of my head, huh. The output chain is not the one I use often. I’d think
nft add rule tracing filter output ip protocol icmp icmp type echo-reply meta nftrace set 1would do it. Just make sure the priority is low enough again.