You do not necessarily get better at playing Bach by only playing music from Bach. For instance, as your sight reading improves Bach becomes a lot easier to manage, but restricting yourself only to Bach would be detrimental to your progress in this case.
I agree with what you said but my issue is for example that my teacher wanted to kind of force me to play a Mozart Sonata (K330 1st movement) as a an "etude" to get better at playing piano. And being pushed into practicing pieces I do not enjoy makes me approach my piano practice time as "work" instead of "fun". So I started to avoid practice altogether And I do enjoy a lot of other composers besides Bach I just want his music to be the main focus
Bach learned to play the keyboard pretty well without ever playing Mozart or Czerny.
Which composers do you enjoy apart from Bach? I agree with the sentiments that some valuable skills that you can apply to Bach may most beneficially be learned from other composers, as paradoxical as that might sound.