Your teachers are talking absolute nonsense and I would advise you to not listen.
First things first, make sure that you do your full research. You may be eligible for some foundation year medicine courses if you meet university contextual criteria which generally have lower entry requirements.
If not then I would suggest a gap year. I don't think I know a single university that doesn't accept reapplicants to their medicine courses simply because they have done a gap year. Either your teachers have said something they haven't researched themselves or they have mistaken it for A-level resits. If so then it is true that some universities do not accept resits, but if you put your all into achieving the grades 1st time then it's really nothing to worry about.
Secondly, gap years can be invaluable to strengthening your application. There is so much you can do from volunteering to paid NHS work as an HCA to extracurricular activities. This will pay off when you redraft your personal statement for 2024 entry and also at interviews.
Lastly, doing graduate entry medicine is actually more competitive than the standard school leaver or gap year route. Trust me, competition is fierce for Graduate entry into medicine.
In conclusion, there is nothing wrong with taking a gap year. It is difficult at times (and I can tell you from experience). Sometimes you will feel down as everyone will likely be going to university except you, but take it as a means of improving yourself and your overall application and you'll hit the ground running next time.
Hope this helps