I generally think of uczeń as learner. I see where pupil is a better translation. Agreed, however, your sentence is far more natural.
Because genitive implies possession. Because the pupil is "of" this school, then the "this school" must be in genitive.
In English, pupil is more often associated with school and children, while student is more university and young adults (although both still work in both contexts, just sound a little weird). Is that the same in Polish? When would you use uczeń instead of student?
In Polish, „student” can only be used for tertiary education(ie. College, University and so on), for lower tier education you use „uczeń” exclusively, so you can't say, for example, „Ten student chodzi do podstawówki”('This student attends elementary/primary school') in Polish.
When I thought of the translation this is how my mind put it together at first. - Jestem uczniem w tej szkole - but when I noticed the declension I had to think through whether it was at or of? Is there a big difference in context?
Well, I'd rather say "tej szkoły". Actually "Jestem uczniem w tej szkole", especially if you put emphasis on 'uczniem' could be interpreted as "I am a pupil, not a teacher!" - that's at least what I think.
Well, I guess it's close enough, especially that its literal translation 'w tej szkole' is a bit weird, as I wrote.
When talking about what one does or their occupation the verb to be "Być" uses instrumental.
Here is an explanation:
And here is a conjugation resource:
I hope that helps.