David Woosey died at his home in Gosport aged 36 in September last year.
Recording a suicide verdict, coroner David Horsley said at an inquest in Portsmouth that the death was a ‘dreadful tragedy’, which followed Mr Woosey suffering from serious, unexplained headaches for 18 months.
Mr Horsley said: ‘He has done this against a background of this severe, debilitating, long-term, undiagnosed headache pain.
‘Despite all the tests and consultations, the source or cause of these headaches is still a mystery.’
But Mr Woosey’s parents, Susan and Geoffrey Woosey, from Wigan, said not enough was done to ease their son’s pain.
They said his death could have been averted if the health professionals who dealt with him had been better co-ordinated.
Geoffrey Woosey said his son’s GP, neurologist and liver specialist had not worked together as they should have to help him.
He said: ‘He was messed around a lot between different departments and no-one took overall responsibility for his care.’
Mr Woosey was found hanged at his home by two friends.
He had left a note saying: ‘I just couldn’t live with the pain from these headaches anymore. Now I’m no longer in pain.’
Mr Woosey was a former Royal Navy submariner, who stayed in Gosport after he left the service in December 2008.
He then worked as a trainee supermarket manager at Aldi, but he was forced to give up this job due to the pain of the headaches.
His headaches started shortly after a holiday in Mauritius in 2014.
CT scan results were negative, and he was prescribed amitriptyline to ease the pain.
But he suffered severe side effects to his liver so the medication was stopped and not replaced.
The inquest heard how Mr Woosey was referred to the liver specialist to determine what pain medication was safe for him, but on several occasions his appointments were cancelled or postponed.
He was given a lumbar puncture, which stopped the pain for a short time before it came back.
Geoffrey said a lumbar-peritoneal shunt had been discussed as a possible cure for the pain, but this was not taken any further, despite Mr Woosey asking for it.
He said: ‘The lumbar puncture relieved the pressure on his spine and made him feel normal.
‘The lumbar shunt was discussed with David before his medication was stopped and he went back several times and asked about it, but never got anywhere.
‘It might not have been a solution because we didn’t know what was causing the problem but it might have given them time to get to the root cause of it. But because someone didn’t put it in a letter it didn’t happen.’
A NHS spokesperson was unavailable for comment.