I just got a valuable mini lesson- great answer! My understanding is that the root note matters and how the melody goes. Chords and keys are not always a science- more of a guide like GPS in a car. You have to judge feel, tonal centers and other things. Some of the best sounding tunes and solo's are technically incorrect- but sound oh so right!..sort of like life.
One question, if I can dovetail and maybe it will also help the OP is this... You say they are the same notes, but doesn't the major scale contain 2 extra notes? Like you said, the F and the F#, he is best to avoid. I have found that in a major key, the mPenta almost always works- but it doesn't rarely works going the other way around.