Med school policies on AP credit and the substitution of an upper level course for an intro one are all over the place. Please consult MSAR for the policies of individual schools.
Read this FAQ on the topic–
Many (most?) med school do allow the use of AP credits for pre-reqs, although every med school that does also expects everyone who uses AP credit to supplement those credits with additional UL coursework in the same academic department which granted the AP credits. (IOW, if you accept the credits for AP bio, you’re expected to take additional UL coursework in the bio dept. )
if you do decide to accept AP credit, do not retake the same class you received credit for. That’s called grade grubbing and adcomms do not look favorably at people who do that.