The only world leader to criticize Castro immediately following his death was (unsurprisingly) Trump. The rest (including the Pope) had the decency to offer condolences rather than speak ill of the just-deceased. 

Pierre Trudeauchad a warm relationship with Castro, who attended his funeral. Justin speaking warmly of that personal bond was perfectly legitimate.

Predictably, there same Conservatives who uttered not a peep of protest when Harper warmly eulogized the far greater despot King of Saudi Arabia, are today the loudest critics. Then they wonder why Canadians showed them the door.