There's absolutely no problem with this.
Your grade in your AP class is a measurement of your achievement at the high school level. An A indicates you did what's expected of you as a junior/senior in high school.
The AP exam is measuring whether you achieve at a first year college level enough to skip that first year in the subject.
More people should get As in AP Physics than get 5s. If they measured the same thing you wouldn't need the AP exam.