Will it affect my academic career if I leave my PhD programme in the middle?
Such things depend more on why you leave rather than just the fact that you do. If you establish a poor record then it is harder to get in to another program.
But it also depends on where you want to study and the nature of the program that you enter. Some programs give you some room and time to catch up with missed knowledge and some programs provide an especially supportive environment for students.
However, at some level, nearly every student is in your situation at some point. Starting research on a narrow but deep problem can leave you a bit lost for a while until you get all of the very specific background needed to go deeper.
But if the alternative for you is to not try, then that alone will negatively affect your career also. And even taking a gap to &quot;catch up&quot; can be good or bad, depending on what you do with the time and how you can verify that you've made necessary progress.
The advice for nearly every student is to just do it and do your best.