From an economic perspective it's basically the same thing. The purpose of raising interest rates is to deliberately make everybody poorer and reduce spending power, reduce the money circulating in the economy.
In this particular case you are correct that targeted taxes would have been a far better idea, primarily on the Boomer cohort.
Instead, over recent years, it is income that has been hammered with tax, but only for a specific subset of taxpayers. The self-employed enjoy lower rates and lower earners benefit immensely from the tax free allowance which has doubled in real terms in the last 15 years and is higher than in pretty much any other country. Meanwhile we have higher earning employees on PAYE paying taxes as high as in Scandinavian countries, but receiving appalling services in return. So the rich whose income is mainly from wealth pay very low rates of tax and low to average earners pay nothing/ very little and our tax base has narrowed and become precariously dependent on around 15% of the population, with them paying at only £50k earnings sometimes marginal rates of 85% plus if they have children due to the tax cliff edge with child benefit withdrawal. At £100k earnings the marginal tax rate can go up to thousands of percent. I.e. work and earn more gross and you'll become significantly poorer^^ in net income. Obviously that is insanity if you are desperate for more tax revenue from these skilled and productive workers who you are relying on to fund everyone else. Nobody will work more for free so UK productivity remains dire and skills shortages abound as people cut their hours to avoid being penalised. And the rest of the population won't accept that if they want decent services then the only way these can be funded is by those who earn average incomes paying far more tax than they do now, like in all of the countries whose services they admire. There is no other way to fund it, it's mathematically impossible.
The interest rate hike was an unsuitable way to curb inflation for a number of reasons including that the cohort it hit the hardest were those mentioned above: those already hammered with fiscal drag and tax and childcare and high housing costs. These are the people with large mortgages. But they also tend to use almost all of their money on essentials so cannot really cut their spending much (the change the interest rate rise is designed to encourage).
Meanwhile the cohort who already had the highest disposable income of any group on average (pensioners, who are better off that working age people now on average) actually benefitted from the interest rate hike because they have the majority of the country's wealth (again obviously talking averages here before somebody pipes up that they are a pensioner and poor and didn't benefit personally. 🙄 There's always at least one who doesn't grasp that analysis of demographic and economic issues must use averages and generalisations and takes discussion of such things as a personal insult because they think the entire world revolves around them 😵💫). So the people who had the ability to spend on non-essentials were given more disposable income by the higher rates. Also these days with most mortgages on fixed rates the impact of an interest rate increase is far slower, and it affects a far smaller number of people due to the rise in private renting and number of retirees who own outright.
So yes, you are correct, a well-targeted tax would have been better. The BoE had no choice but to raise rates though because of their mandate and it being the only lever they have. It is fiscal policy from Government that should have been different. But they would never have contemplated the alternatives like reducing pensioner welfare/ taxing pensioner assets/ making pensioners pay NI/ equalising capital gains tax and income tax because the pensioners vote for them. They just continue to hammer those of working age even though the economic damage it is doing is crystal clear and is storing up even more problems for the future.