When using shell array indexing expressions like ${array[var]}, command validation fails with error:
Bad substitution: levels[31224
This occurs when trying to validate shell commands that use array indexing with variables, such as:
level=${levels[30232 % ${#levels[@]}]}
The error is thrown by the shell-quote library when parsing these expressions.