What happens when you delete ~/.Trash folder on macOS

I have done some stupid stuff and managed to delete the ~/.Trash folder on my Mac. The result was surprising:

To fix this you can type this in the shell:

mkdir ~/.Trash

This is clearly bad user experience. Somebody not knowing how to fix this will just assume that the trash stopped working. Even worse, they might miss the message and just click on Delete.

What should macOS do in this case, is to silently restore the trash folder and keep on humming.