I've no idea why this was so down-voted, it was just a question!
So anyway, I've just looked into it, and yes, they are different words, as in they have different etymologies, it's not just two different uses of the same word.
Meaning on/at comes from Sanskrit उपरि (above) via Sauraseni Prakrit.
Meaning but/however comes from Sanskrit पर (distant/further), through its oblique परम (after/but) again via SP.
For completeness, पर is also borrowed directly from Sanskrit for the (distant/further/remote) meaning; and fourthly and finally, the meaning feather/wing/quill is borrowed from Persian.