Well, I consider it a bug when a line of code doesn’t do what it’s supposed to do.
Anyway, it’s fixed: FIX: Outgoing emails were not disabled after restoring backup · discourse/discourse@dc961fe · GitHub
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.