Five months after the devastating fire that killed more than 1,100 clothes factory staff in Bangladesh, an investigation has found evidence of employers abusing workers’ rights.

The BBC’s Panorama programme found staff making clothes for the cut-price retailer Lidl, some reportedly working 19-hour days – and even being locked inside the factory. According to the investigation, in the past 10 months there have been more than 50 factory fires, with many workers killed because the gates have been locked and they have been unable to escape.

Panorama secretly filmed a security guard locking the front gate. One worker, who had earned around £2 for his 19-hour day, said he had to be back at the factory in four hours. “My feelings are bad and my health is too. In the last two weeks, approximately, it has been like this for eight nights,” he said.

Download the new Independent Premium app Sharing the full story, not just the headlines

When the programme’s reporter visited the Ha Meem Sportswear factory posing as a Western buyer, he says he was given time sheets that falsely claimed the shift ended nine hours earlier.

The factory denied that workers were forced to work 19-hour shifts and said a second gate in the building was open. It said the programme’s allegations about time sheets were “false” and the factory works legally and does not deprive workers of their rights.

The programme, which will be broadcast tonight, found another factory, reportedly making clothes for high-street retailers including Gap and H&M, which was also hiding its long hours. It found that the working day here sometimes started at 7am and finished at 10.30pm, but not all of the overtime hours were shown on the workers’ payslips. When the reporter visited this factory, he was told the working day was only 10 hours long.

Panorama said the factory later admitted it had two sets of books, but said it was compliant with the law and that workers were never forced to do overtime. It also said some employees were working additional hours in order to extend their holidays.

Most Western retailers have codes of conduct that limit working hours, which are supposed to be enforced with regular audits.

Lidl said it could not comment until it had seen the programme, but in a statement to the BBC it described the findings as “concerning”, adding it had invested £6m to improve living and working conditions in Bangladesh.

H&M said overtime “remains a major challenge”. It said it monitors overtime at the factory by checking documentation and interviewing workers, while Gap said its clothes made up less than 5 per cent of the factory’s output and it had no plans to place further orders. It added that suppliers are required to comply with its code of conduct.

The makers of the documentary also visited the remains of a garment factory on the outskirts of the capital Dhaka where more than 100 workers were killed last November. The visit was made amid accusations that the UK retailer Edinburgh Woollen Mill used the factory in the months leading up to the fire and refused to pay compensation to families of the dead. It strongly denies the claims made by former workers at the factory.

Panorama - Dying for a Bargain is broadcast on BBC1 at 8.30pm on Monday 23 September