You may have misunderstood some parts of the system.
If you make a pension contribution in any given year, the tax relief is based on your income for that year - the gross pension contribution is subtracted from your gross income and you only end up paying tax based on the reduced gross income.
So if the higher rate threshold is £40K, you have income for the year of £65K, and you make a gross contribution of £25K, then you'll get tax relief at 40% on the whole contribution, i.e. £10K. If your income for the year is less, e.g. £50K, then you'll get tax relief at 40% on £10K and at 20% on the other £15K, i.e. £7K.
So if you're significantly into the higher-rate band, it's usually not worth making a contribution large enough to reduce you to basic-rate tax - better to wait till the next tax year for the rest.
Overall, while you probably could do what you suggest subject to the caveats below, why not just spread the pension contribution over the three years, rather than making it all up front?
If you are confident you can invest the money at better than the 3.4% interest on the loan, then it might make sense to borrow, but you should be pretty clear that you're deliberately borrowing to invest (otherwise known as investing with leverage). Or you might know that your income is going to drop next year.
Another clarification, as your comment on another answer mentions: basic-rate tax relief is claimed directly by your pension provider ("relief at source"), whereas the higher-rate part of the relief comes straight to you via your tax return. So for the above £25K gross contribution example, you'd hand over £20K initially and then get £5K back at the end of the tax year, leaving you with £15K less in your pocket. If you did want to make a £20K net contribution and had enough higher-rate salary to cover it, the gross contribution you'd end up with would be £33,333, and you'd need to find £6,666 more temporarily.
Note that there are also limits on the annual contribution you can make of £40K (the "annual allowance"), but you can carry forward allowances from three previous years so it's very unlikely to be relevant.