This seems to be a pg_rag bug: neondatabase/neon#10726
If postmaster dies unexpectedly, the background worker processes should exit quickly. Normally that's handled by using the WL_EXIT_ON_PM_DEATH flag in WaitLatch() calls, and / or checking PostmasterIsAlive() periodically.