This probbably should be a bug report, but since the issue have been aroud forever perhaps it could be concidered a feature.
Bash indenting is very sensitive to characters. For example a space behind "do" in while/for loops will throw it of.
Indenting whithout a space trailing "do"
When you have nested loops this is very ugly, and makes it hard to follow the code. I who now know about this oddity can probably live with it. But how many users will not take the time do search the cause of this behaviuor, and just silently suffer? Or go back to editors who handles this (emacs).
And while I'm at it, bash indenting for case is also faulty and have been since at least 2012. Why not give bash indenting some much needed love?