The fact that this had to be covered in court is absolutely insane, considering ending someone's employment due to maternity leave isn't legal in Canada.
The company that laid someone off right after their return should be fined and required to pay a generous severance, not to mention EI should definitely be applicable since not only did the employee not quit, they were let go through no fault of their own.