If you are getting a different result with any tool locally versus Galaxy, try comparing the command line Galaxy used with what you are using locally.
Find the Galaxy command string on the Dataset Information page ( icon in each dataset) in the section “Job Information”. This is the same page where other job logs are found.
You can also scroll down a bit more to the section “Job Dependencies” to learn the version of any dependencies that were used. For Samtools, the version probably won’t make a difference, but could with other tools, including tools used upstream.
You are trying to reproduce the filter step here in the tutorial, correct?
If yes, the command line is this, and is the same as you would find in the Galaxy command string log: