This is not a bug. "local" is a bash-specific feature which is not defined in the POSIX standard for sh (the POSIX shell).
If you want to run scripts that require bash-specific features, then you should change them to use #!/bin/bash at the top; by using #!/bin/sh you are agreeing that your shell script uses POSIX-compliant features only and will run with a POSIX standard shell.
This is not a bug. "local" is a bash-specific feature which is not defined in the POSIX standard for sh (the POSIX shell).
If you want to run scripts that require bash-specific features, then you should change them to use #!/bin/bash at the top; by using #!/bin/sh you are agreeing that your shell script uses POSIX-compliant features only and will run with a POSIX standard shell.
Cheers!