How to Make a Safe Shutdown Button for Raspberry Pi

My guess is that the Python script is waiting for the Terminal operation to finish running before continuing.
Try running it with an “&” character at the end of the line to suppress the output and it may work,
os.system("python3 /home/pi/picam.py&")