In scenario 1 you are doing:
set passed-to-program2 to type Environment::CommandLine.
accept passed-to-program2 from command-line.
where you should only be doing
set passed-to-program2 to type Environment::CommandLine.
the accept statement is overriding the value that is coming in from the set statement so remove the accept any then you should see the value that is being passed.