Dutt was offered a cameo role which was eventually played by actor Nawazuddin Siddiqui.
"I think every role written in the film industry goes to him first. It passes through him and then it filters down.
"It was my first production. It was a special appearance and we wanted to carry it in the second part. Anurag Basu (director) and I thought there was nobody better than Sanju sir to play the part," Ranbir told reporters.
The actor said they couldn't go forward with the idea due to some issues related to Dutt's comeback film, "Bhoomi".
"The first time he (Dutt) heard it, he gladly agreed to do it. But there were some issues with the release of his first film. So, I thought may be the next time," Ranbir added.
Dutt said he hasn't watched "Jagga Jasoos" yet but "completely loved" the trailer.
They were speaking at the trailer launch of Omung Kumar- directed "Bhoomi" here.
The 58-year-old actor said he found the story of the film perfect for a comeback.
"It is an emotional story, so I thought if I am coming back after three years, this is the best film. It is about a father-daughter relationship.
"The shooting process was a lot of fun. I was a little nervous initially but after delivering the first dialogue, I felt relaxed," he said.
"Bhoomi" is scheduled to release on September 22.