That’s not a bug. It’s a feature that was added a long time ago, but it was broken for as long as I can remember.
I fixed it two months ago in https://github.com/discourse/discourse/commit/dc961fecb9c28be5e8f161a82616148be6a9facc#diff-f59428cd341969776f9ebf8c157b83c7
You can disabled that behavior when you restore from the command line:
discourse restore --disable_emails=false <filename>