There are two parts of this story. Khanna had a meaty role in Chandni but there were drastic changes made in the script which upset Vinod Khanna.
The original script of Chandni had Rishi Kapoor dying before the intermission. Khanna's character was meant to step in and marry Sridevi taking over the narrative for the emotional second half.
However, the plot was heavily re-written during the shoot, resulting in keeping Rishi Kapoor alive and restricting Khanna to an extended cameo.
Also, Chopra altered Khanna’s persona in the film. Khanna was known as an action star and his entry in the film was an action sequence where he was supposed to save Sridevi from fire. This alteration of scene by Chopra ended-up Khanna's character as a purely mature, non-action romantic interest. Vinod Khanna was upset due to these reasons.
However, he worked with Chopra again in Parampara but Chopra was not the producer of the film. This collabration was a combination of mutual consent, a sort of patch-up and a last minute replacement.
Anil Kapoor walked off the project on the first day of shooting realising he had been cast as the father to the younger leads. Jackie Shroff was advised by Ghai not to do the film and Anupam Kher was busy shooting for Khel in Kenya. Khanna was the last minute replacement for Anupam Kher who was then given a different role in the film.
So, basically Khanna did not leave Yash Raj Films. His first time experience was not good and later the conditions never fell into place for him to unite with the production house.
Image(s) Courtesy: Google