Agreed entirely. I inherited a system with 50k lines of unreliable shell scripts. I figured out ways to unit test them, do mocking, and pushed developers to unit test their scripts. I even wrote long articles of best practices for writing reliable scripts, including massive lists of gotchas.
Eventually I realised it was a lost cause and really you just shouldn't use shell scripts for anything that you want to be reliable above a trivial level of complexity.
That was with PowerShell, but I wouldn't be surprised if the same applies to bash as well.