Like the previous exercise, this one is also correct as it is within range. Being “out of range” for the pattern, would be the case only if you had to move your hand out of position to reach the note in question. Maybe you are getting confused because when practicing the scale you are ending on the 5 and not the 6 which is within reach. I purposely end and start all scales on chord tones when teaching them for your ears to get accustomed to hearing a “resolution” on either the last note on the 1st or 6th string. Hope this is clear 🙂