The immense amount of smoke right in the face is almost as bad as the flash and bang itself.
It's a bit annoying with a regular versions, but with it right there in your face, the irritation to the eyes and nose are prohibitive. And of they make the mistake of breathing, they'd be looking at a minutes long coughing jag.
With them already being underground with poor ventilation, that's a nightmare. If you're out shooting muzzle loaders with friends, and there's no breeze, you can end up with a fairly dense cloud after just a handful of shots. Makes the next round harder to place on target, if nothing else.
But, yeah, there's no technological barrier to hearing protection, so that issue is easy to fix. It's the flash and the smoke. The idea of a partial barrier would reduce the flash to the eyes, but not eliminate it. So you'd want to work in some kind of exhibition of that happening in your story or game. Outdoors, in light, the affect wouldn't be major. But in dim lighting, even modern firearms can have enough flash to screw with night vision.
This kind of weapon in the tunnels that dwarves often call home would be something specialized (imo). They'd have a small number of them either taking the first shot and then fading behind foot soldiers, or firing from behind foot. The smoke lingering is going to be a big problem for the battlefield underground.
Well, I guess you could handwave and say that dark vision isn't occluded by smoke and other particulates. But that assumes you have dark vision in the first place it isn't always a dwarf trait. That still isn't great for the dwarves. Their enemies would end up with an advantage from using those, if you're using d&d style underground races.