IF SUCCESS is the sweetest revenge then the makers of “Mersal”, a Tamil-language action-romance, must be feeling smug. Supporters of the Hindu nationalist Bharatiya Janata Party (BJP) vented fury when the film was released in mid-October. Some shouted that it should be banned, unless a scene mocking government policy was cut. Others sniffed that the film’s lack of patriotic spirit might reflect the fact that its star, Thalapathy Vijay, is Christian. But for “Mersal” all this ugly talk was just good publicity: it has already grossed over $32m, close to a record for Tamil cinema.

The backfiring of this attack might be read as a parable for the troubles facing the BJP. It had seemed an unstoppable juggernaut, set to roll through a string of state polls up to the next general election in 2019 and beyond. It still holds trumps that any party would envy: a network of more than 110m members, generous funding, a largely sympathetic press and an energetic, charismatic leader in Narendra Modi, the prime minister. His government can also claim solid achievements: it is currently trumpeting India’s 30-rung climb up the World Bank’s Ease of Doing Business ranking in a year, to 100th place. Besides, the opposition remains feeble and divided.

Yet a series of costly policy flops, along with an accumulation of dents to the party’s clean image, have combined to put Mr Modi on the defensive. For six weeks last winter Indians scrambled to make ends meet when the government abruptly scrapped 86% of the country’s cash. Many suffered cheerfully, believing they were helping Mr Modi chase money-hoarding bad guys. But as time has passed, few can see any gain from the pain.

Eight months after “demonetisation”, the government launched a national goods-and-services tax (GST) with fanfare. It is meant to unify and simplify India’s bewildering array of state and local taxes, thereby helping business and boosting revenue. So far, it has done neither. To its credit, Mr Modi’s government has responded to complaints by exempting more of the tiniest firms from the tax and pushing back filing deadlines. Even so, the complex, six-tiered tax, requiring multiple filings and hefty upfront payments on inputs with only sluggish reimbursement, has proved so burdensome to small businesses that many have scaled back work. Consumers, meanwhile, are cross about high rates on certain items (28% on shampoo).

As with demonetisation, the GST roll-out appears to have been sloppy and hasty. A more recent reform, a big bail-out of state-owned banks saddled with some $150bn in rotten loans, is neither of those things. The rescue package is cleverly devised, but woefully late: Mr Modi had ignored repeated warnings, notably from Raghuram Rajan, his own central-bank chief who was sacked last year, that the debt pile was smothering investment.

For the Indian public, policy foibles would be more forgivable if they were not accompanied by so much hype, as well as by aggressive attacks on critics. A scene in “Mersal” that the BJP found offensive, for instance, included a rant against GST. Within hours of airing a report suggesting that the son of the BJP’s powerful president, Amit Shah, has profited in business since the party came to power, the Wire, an online news magazine, was fiercely attacked by ministers and slapped with both a gag order and a criminal lawsuit. Authors of books investigating wealthy patrons of the party have been similarly assailed. Such pressures, as well as threats to advertising, have prompted wary media groups to fire critical editors. Ordinary citizens have also been hauled to court after posting jokes about Mr Modi on social media.

One person who is joking more at Mr Modi’s expense is Rahul Gandhi, a scion of the Nehru-Gandhi family who is expected to be anointed head of the opposition Congress Party soon. Mr Gandhi, who until recently was widely regarded as a political weakling, has begun offering a steady barrage of acerbic barbs, to growing effect. In the past few months his following on Twitter has grown by two-thirds, threatening the BJP’s dominance of social media.

Congress is also mounting an unexpectedly strong challenge to the BJP in Mr Modi’s home state of Gujarat, which holds elections in December. The BJP has reigned there for nearly 20 years, and few expect it to be unseated. Yet Mr Modi is taking no chances. He has campaigned furiously and showered the state with handouts. If the BJP loses even a little ground, some will say its efforts backfired.