Well, I consider it a bug when a line of code doesn’t do what it’s supposed to do. Anyway, it’s fixed: https://github.com/discourse/discourse/commit/dc961fecb9c28be5e8f161a82616148be6a9facc
I made a small adjustment, because I think it’s better to disable outgoing emails only for non-staff users instead of all of them.