Hi! I live in Germany and use Stuttgart Hbf often. I would not expect you to be able to make a 9 minute transfer in Stuttgart, and a 4 minute transfer under most conditions anywhere. Trains operated by Deutsche Bahn are frequently delayed. German trains are really the laughingstock of Europe at this point, and any time I'm riding a DB train that's actually on time, I take photos to send to the family group chat. If that tells you anything. I ride the trains on a near-weekly basis with multiple changeovers and it's rare not to have a 5-10 minute delay on at least one.
It also takes a certain amount of time to get off the train (and keep in mind usually you're waiting for everyone else to get off the train along with you) and orient yourself with regard to the train platforms, even before you start walking from Train Platform A to Train Platform B. I've certainly managed to make it from one train to another in four minutes or less, but: (1) I am familiar with the station layouts because I use them often, (2) In fact, I usually know which end of the train I should be on, to exit the train closest to the stairs, (3) I don't travel with more luggage than a backpack, and (4) I'm in good physical shape and can sprint.
IMHO, give yourself at least a half hour of breathing room. Even an hour would be fine, if you wanted to give yourself some time relax and to walk around. You can exit Stuttgart Hbf to the Schlossgarten in Stuttgart, which is reasonably pleasant, or you can walk around the exhibits showing Stuttgart 21, one of the most infamous ongoing construction project boondoggles in German history!