But is it grammatically wrong? I understand that it's not a good way to use google search to check usage frequency of some phrase but it still provides you a general idea. It gives quite a number of hits if you use the search phrase "exam on physics"; you can replace the 'physics' with some other subject.
Do you find the use of "on" in the following sentence unnatural
I'm not sure whether using "on" is technically right or wrong, but it's certainly not the best way of stating this information. Here's a couple alternatives, depending upon the context of the sentence:
My next exam is about physics. My next exam is in my physics class. My next exam is on the topic of physics.