An Afghan man missed some epilepsy medication dispensing appointments at a Western Australian detention centre due to his irregular sleeping hours and it may have contributed to his fatal seizure, an inquest has heard.

Mohammad Najafi, 26, died following an epileptic seizure at Yongah Hill immigration detention centre on 31 July 2015.

Najafi arrived in Australia illegally in November 2012 and spent 1,003 days in custody at Christmas Island, Curtin and Yongah Hill immigration detention centres, the WA coroners court heard on Tuesday.

Counsel assisting the coroner Lyle Housiaux said Najafi had a history of epilepsy and had been referred to the Royal Perth hospital’s neurology clinic in late 2014 but was not seen by a neurologist before he died.

Najafi was required to attend the medication rounds twice a day to receive single doses of Carbamazepine but, due to his irregular sleeping hours, he missed some appointments and was warned by nurses.

“You may consider this may not have been a practical and reliable alternative to providing him with a weekly supply of Carbamazepine,” Housiaux said. “Mr Najafi had made a formal complaint regarding this dispensing practice in October 2014, and records show that he demonstrated his frustration regarding this approach on July 25, 2015 – six days before his death.”

Housiaux said it was unclear whether there were processes in place to ensure Najafi received his medication and records showed he had a history of seizures associated with missed doses of Carbamazepine.

“It may be a matter for your honour that this was not satisfactory or reasonable care in the circumstances because it may be the case that the reduction of Mr Najafi’s dosage of Carbamazepine may have significantly increased the risk of Mr Najafi having a seizure,” he said.

When a Serco officer checked on Najafi at 6.30pm to hand him a letter, he appeared to be asleep so he was not disturbed.

Just over two hours later, the officer returned to Najafi’s room and found he was not breathing.

Paramedics were called but Najafi could not be saved and he was pronounced dead 30 minutes later.

The inquest continues.