How about just a larger and even more deadly/violent Sepoy Rebellion that escalates out of control into full-on civil war? After the British win said war, they tighten their fist on India even harder, which only leads to more rebellions in the long run. None of this would change the fact that growing alliance systems, military escalation, inter-Power colonial clashes, and jingoist politics would eventually lead to a large scale European war with machine guns, and thus, trenches: an alternate Great War. In this Not!Great War, the British conscript thousands of sepoys to fight in the Middle East against the Ottomans or in southern China or something, and this is the last straw.
After the War is over, cries for independence against the hated British would ring out from across the land, and violent rebellion would start in urban pockets. The British could quell it again and then, seeing that India would eventually break free anyways and watching their money spiral down the drain trying to hold it, decide to give India nominal independence, with its own Parliament representing its various parties (which would be different, and possibly much more divided, as the National Congress wouldn't have been created ITTL, what with Britain's stricter philosophy on Indian matters.) They could give the whole Raj independence as "The Indian Raj" with this new Parliament, and with a few conditions: Britain gets heavy trading bonuses (almost like an actual colony still) for a number of years, the Raj agrees to ally the British militarily, British companies get favored over other foreign or local companies, and, of course, a British monarch gets the (mostly figurehead) throne (so the British public feels less cheated after fighting a war to keep India in the Empire.) A compromise of sorts. If the Indian leaders decline, Britain threatens to cut down the few remaining freedoms the Indian people still hold and violently keep the Raj under its fist, strongly implying they will kill the national icons for sedition or something. Would Britain actually be able to follow up completely on this threat without eventually inciting another independence movement? Probably not, but all we have to do is have the Indian leaders cave in to this compromise for this to work, with this happening plenty of times in history in other places.
That's the only way I can see this playing out in a semi-recognizable world and without stretching the imagination too much. Of course, there are others, as always, but that's my take.