Why am I bad at running and walking stairs but much better at swimming?
Considering you haven't provided much information on your physique it could be for a multitude of reasons. Body type is important in guiding you success in each sport. Swimmers tend to be taller with a longer torso and shorter legs and runners thend to have a heavier center of mass at their bellybuttons and slightly shorter statured bodies. You probably have noticed that many African Americans are extremely successful runners and not swimmers. While genetics and physiology is not the only reason, African Americans tend to have a heavier center of mass at their bellybutton which proves adventageous in running and not swimming. It could also be your technique or you mind telling you you are bad at one and good at the other, just practice and you can become proficient at whatever sport you desire.
Oh I didnt read your whole description, train your aerobic fitness. Maybe your swimming technique is slightly better or you just dont like running as much so you get tired faster (you make yourself think that). Could be that your legs are not trained that well but your upper body is, and you let your legs drown behind you while you swim.