It's not
technically true, but there is a lot of truth in it.
There are lists of recommended treatments, and there are many restrictions on prescription of medications, expensive ones in particular.
At a national level, NICE[0] (or SMC[1] in Scotland) decide what medicines the NHS will pay for, and for what conditions. They determine what medications are licensed for different treatments. They also set guidance on what treatments should be used for different conditions, what the 1st line, 2nd line, 3rd line treatments should be, and what treatments they think should not be used.
At a regional level, there are "formulary" groups, which take the national guidance, and make some tweaks - for example, for monetary reasons, they often increase the restrictions on expensive medications, making them harder to obtain. An example of those restrictions might be that the patient has to have been suffering for longer, the impact of the condition has to be more severe, or the patient must have tried several other (cheaper) medications first.
For expensive medications, it's often not as simple as a consultant saying "I want my patient to have this" - at a regional or hospital level, there are quotas/limits on how many patients per year will be treated with sich expensive medications, and there are comittees that meet regularly to decide who is worthy.
Now, if we put aside those expensive medications for moment: yes, technically consultants are free to use their experience, knowledge and judgement, and prescribe what they see fit (even unlicensed drugs) - but in reality, within the NHS it is uncommon to prescribe outwith the regional formulary guidance, or/and outwith licensed medication uses. There are a number of reasons for this:
1. Consultants take on individual liability when they prescribe unlicensed medicines, and individual hospitals fear legal risk too
2. Consultants will have their balls broken by their department head when they prescribe expensive medications - dept heads have budget responsibility, and in turn they will have their balls broken by the board
3. Consultants regularly meet with others from their department to discuss difficult/unusual cases, and have to justify their decisions to the panel
4. Perhaps it's the workload, but (IME) NHS consultants often have outdated knowledge. I swear some have never so much as read a journal article since they left medical school 30 years previous :( Again IME, private consultants seem to be much more confident to think out of the box with treatments; perhaps it's the commercial competition?
[0] https://www.nice.org.uk
[1] https://www.scottishmedicines.org.uk