A payment error at a store owned by Loblaws in Surrey, B.C., is "a great cautionary tale," says Toronto law professor David Doorey.

The massive retailer accidentally overpaid several of its employees, saying it was a "human miscalculation."

After realizing the mistake, Loblaws gave the affected employees 20 days to repay, and threatened legal action if they didn't comply. The employees balked, saying they were being unfairly forced to pay for Loblaws' mistake.

Loblaws apologized Friday, adding that it would not seek repayment from those employees.

The issue was a "potential PR nightmare" for Loblaws, said Toronto forensic accountant Edward Nagel.

Doorey said overpayment of wages and attempts to recoup them are relatively rare, but the problem can be difficult to resolve when it does happen.

Despite the legal headache the blunder created for both Loblaws and its affected employees, there are three main lessons to be learned:

1. Onus on both parties

Nagel says errors like this happen in "100 per cent of organizations." He said the onus is on both the employers and employees to make sure their payments are correct.

"The fact is, if you didn't earn certain income, then you shouldn't be paid for that income," he said.

Connor Greenwell, one of the Loblaws employees who went public when the grocery giant tried to claw back its lump sum payment to her, told CBC News she had questioned the company's calculations two months ahead of the payout. But she says Loblaws reassured her the $15,000 amount was correct.

Nagel said Loblaws was being aggressive in its approach toward the employees, especially since it wasn't the employees' mistake. But an employee who notices overpayment has a responsibility to resolve that with the employer.

2. Paperless systems are vulnerable

Most companies have been making the transition to paperless accounting for the past several years, and some have stopped offering paper pay stubs altogether. This coupled with direct deposits means accounting errors can go unnoticed more easily.

"We have to be, unfortunately, more proactive today than ever before, because most of our life is now paperless and most of our day-to-day expenses and what have you are not documented as it used to be, where you get a physical paper statement," said Nagel. "So much is done online — you have to be proactive rather than reactive."

Nagel suggests a monthly review of pay stubs and bills to make sure everything is squared away.

"These are often human errors, and over time humans become complacent in how they perform their functions," he added.

3. Unexpected 'windfall' for workers

While the employees in the Loblaws case were anything but happy with the situation at first, Toronto lawyer Howard Levitt said mistakes like these can be a good thing for the employees.

"I think the average employee would be ecstatic if this happened to them," he said. "Let's face it — they got a windfall they never should have gotten in the first place."

Levitt said the employees are actually better off now than they were before, despite Loblaws' threat of legal action. He said the affected employees were in a good position to make a deal to keep some of the money from Loblaws. The employees will be able to keep their accidental overpayment​.

Levitt echoes Nagel's advice: careful accounting is key, especially in the digital age.