Illuminating discussion about it here from 2010: Rightsnet: DWP guidance to GPs on providing medical reports
Further links on that page unfortunately now out of date, but it helpfully quotes DWP FAQs for GPs:
"Q: A patient has asked for a report to support his appeal after having his Incapacity Benefit withdrawn. Do their GP have to provide a report?"
"A: No. GPs, as certifying medical practitioners, have a statutory obligation to provide statements of incapacity to patients on their list and certain information to a healthcare professional working for Atos Healthcare on behalf of DWP when requested. However, under their NHS contract there is no requirement for GPs to provide reports or offer an opinion on incapacity for work to anyone else unless requested to do so by Jobcentre Plus.
"Claimants should contact Jobcentre Plus or the Appeals Service, where appropriate, if they think that further medical evidence is necessary to support their claim or appeal. They should state clearly their reasons for believing that further evidence is necessary.
"If Jobcentre Plus or the Appeals Service consider that further medical evidence is necessary, they will seek it. They will be responsible for paying any fee to the doctor providing the report.
"So NHS GPs are under no obligation to provide such evidence to their patients nor to provide it free of charge. If a GP does not agree to provide additional evidence for their patient then it is a private matter to be resolved between the GP and their patient."