1st Flair was not leaving WWE at the time of the title switch. That wasnt decided until the very end of the year when VKM told him he didnt have any main event storyline plans for him in the near future.
2nd Savage wanted off the road after his separation and divorce from Liz. The "knee injury" was an angle concocted at SummerSlam to explain him not beating Warrior out right AND losing in the figure four to Flair at the next show. Savage did not get to leave the road right after the loss, he spent a month after dropping the title putting over Scott Hall, who had just debuted from WCW and was briefly alligned with Flair in the story as a way to help get him over as a heel with fans.
3rd WWE was banking on continuing the Flair vs Warrior angle they started before SummerSlam. If Savage wanted off the road and wasnt right due to personal problems he would be used in the story briefly to help establish Flair vs Warrior with Flair conning Warrior into thinking he was working with Savage (and vice versa, making Savage think UW & Flair were allies) to confuse both men and completely screw up the S-Slam bout between them were Flair causes Savage's knee injury leading to his screw job title win. UW understandibly would be upset, cheated by the title obsessed Flair out of his title opportunity. On WWE TV they began hyping Flair-Warrior almost immediately after S-Slam. Flair did a short series of matches overseas vs Savage & Hart and a short series vs Taker in the US before starting house show bouts vs Warrior. Hart was not involved in the story at all except for a couple of title bouts won by Flair on The European Tour that got no attention on WWE TV (but were covered in US wrestling magazines).
Warrior messed up the press slam spot vs Flair in a house show match in Phoenix. Flair has taken partial blame over the years saying he was calling a lot of high impact spots in their match because Charles Barkley was attending and he wanted to impress him (the two were friends, Barkley even did a pro Flair promo on Nitro a few years later). Flair did this despite Warrior's rep for sloppy ring work, although by this time they were wrestling on a regular basis and he thought UW would be OK. Warrior dropped Flair on his head, dislodging bone fragments in his ear, causing severe vertigo. Flair has credited ref Earl Hebner with saving him in the match, saying UW missed signs he was legit hurt and wanted to continue the match but Hebner stopped him, did a count out and ended the bout. The problem was the injury, hard to diagnose at first, wasnt going away. Certain movements would cause the fragments to dislodge after falling back into place causing unexpected vertigo, sometimes severe. Flair, who even went to the Mayo Clinic for treatment, couldnt keep wrestling. The idea of a blow off match vs UW at S-Series was in doubt with no time table for when Flair could return. UW however was having issues with WWE, causing a turn in booking. Instead of just expediating Warrior's title win now and getting Flair off the road they went with Hart. Hart was very popular with fans and had excelled during his IC Title push. He was also someone who would go on the road extensively, a major asset in the post Hogan era with live gates falling off. Finally, with Warrior falling out of favor, Flair injured, and Savage not interested in the work, Hogan & Piper gone with the federal steroid investigation heating up, Hart was the best option as World Champ. Due to Flair's injury the title switch was booked ASAP. It was taped for TV but not shown because Flair, struggling to maintain his balance and equillibrium, can barely move.
The title switch happening as quickly as it did had nothing to do with Flair refusing to job to Hart or not wanting to lose on TV. Once he returned healthy a month later (WWE TV never explained his injury, stating after Hart won that he was taking time off with an injury and then promoting his return a month later) Flair initially wrapped up his feud vs UW (beating him up on SNME, causing unspecified injuries that forced him out of a tag match involving Flair at S-Series) and then proceeded to put over Hart several times on tour while also feuding with Curt Henning culminating in the Loser Leaves Town Match that Flair lost cleanly in thd main event of Monday Night Raw, about as a high profile loss a guy could take in his last appearance with the company. Flair by then had already helped establish a Hall - Hart feud and the decission was made booking wise that Henning would benefit more from a big win over Flair on his way out, immediately establishing him in the main event scene in his return.
Hart was in the right place at the right time due to a confluence of events he was not involved in. Sometimes that happens. He worked hard and was a good champion, held back more due to lousy booking and VKM's initial preoccupation with the federal steroid investigation. Warrior's many issues probably cost him a chance to be the standard bearer of WWE in the post Hogan era. Savage eventually returned to full time wrestling but with WCW, the exact reason for his WWE departure (and exclusion from the HOF) subject to much debate. Flair left on good terms with VKM. In retrospect he should have stayed.