This was caused by the getopts builtin. Now the regular arguments are processed and removed from the parameter list before getopts is called, so it can parse all of the provided options, regardless of whether they were specified before or after regular arguments.
For example, if --foo requires a value and --foo --bar is specified in command line, then --bar would be mistakenly recognized as the value for --foo. Now a proper error is raised requiring a value for --foo.