It really depends on who is teaching wnd the quality of the high school. I am making a key assumption that high schools offering numerous AP courses are of high quality, and in these cases, AP courses completely demolish intro courses in any college including Ivy Leagues.
Continuing with the anecdotal example, all my AP science classes were taught by engineers. The classes were designed in such a way that even a college sophomore will fail if they don't work their butts off. I failed many exams but in the end, i managed to master the key concepts well and used them to bypass most/all intro courses and still do well in upper levels. The same also applied for non-science AP courses.
YMMV, but the quality of the high school really matters for AP/IB to be valuable, but even the exams themselves are much more effective than any intro courses.
I attended a top 30 (top 10 at the time) high school in the country [happy to PM you the high school name, if you are curious] per USNWR. I aced AP Biology, and got a 5 on the AP exam. I received college credit for Bio I&II with both labs. I then went on to take intro Biology at a large state college (not very rigorous), and still found that what the AP tested me on was nowhere near congruous with the density and complexity of the material I learned in college. Likewise, the teaching scenario was hugely different - from a 20 person high school class with a PhD teacher to a massive 500 person lecture hall. I didn't necessarily find the course more difficult, but I definitely did
NOT learn the same depth and breadth of material from my high school course as I did in college.
Again, this is only n=1 and only for Biology, but seeing as I scored a 5 on the AP, aced the class at a nationally renowned high school, and subsequently took the course at a 4-year university not known for academic rigor and still felt this way, I strongly disagree that succeeding in AP courses translates to a college-level mastery of the subject, particularly in the sciences. I do concede that I had a decent foundation for taking courses at the college level, and was able to get easy A's and I think that my AP coursework is responsible for that. Still, in no way was the education on the same level. As for non-science and liberal arts AP's, I can't really offer much because I was happy to take the AP credits and run.
This is probably a moot point because in many cases, medical school applicants will have to take upper-division courses which cannot have AP credit earned as part of their pre-requisites. I would argue that in the process of "catching up" to the upper-level material, a student has adequately grasped the material.
I would say that medical school's present policies regarding AP's - that they'll accept the credits so long as the university granted these credits on the student's transcript - are fair. For those students who are STEM majors and are likely to take upper-division courses, I've always advocated taking the courses in college anyway - if you are good at STEM stuff and can afford it. With the AP's, you'll at least have the exposure to give you a head start and hopefully make the course an easy A, and still using your knowledge in a way that benefits your GPA and transcript.
The truth is, though, as
@md-2020 2020 mentioned, doing well in an AP is going to be way easier than doing well in the class at a college level. If you tend to perform poorly in STEM courses and think you will do poorly here, then it's probably a strategic decision to take the credits and run. It will save money on credits and time in UG, as well as saving some stress. But I think it is more than fair for medical schools to expect some upper division work to demonstrate proficiency in the subject.