This is behaving like your are sourcing the script instead of executing it. If you use a dot and a space before the script, it causes the script to be executed line by line inside your current shell instead of creating a new shell. This allows environment variables that are changed inside the script to leak into your current shell's environment, which can make one run of the script not behave the same as the next.
In this case, it appears to be the use of getopts. getopts updates an environment variable each time it is called so it can keep track of which argument is being examined. The second time you source the script, it thinks that all the arguments have already been examined, so your argument ends up being ignored.