I just verified that deleting a user does delete user’s queued posts.
@vjFaLk to resolve your issue, I pushed a fix that will not raise server error when opening “Needs Approval” page:
https://github.com/discourse/discourse/commit/e2df79ee9e8d93dd1af25a0b360ddbd352ef3232
Updating your instance to latest should fix this issue.
I am still interested in knowing how your instance got into this state, see if you see anything odd on “Needs Approval” page. A post without user sounds strange.