If a power supply is not grounded, what situations could cause electrocution?
It's not clear for me which ground was missing from your device:


if it is the PE connection that is failing, I would say only a short between the housing and the mains line (caused by loose cable, screw inside the housing, etc.) would cause danger
if you meant the power ground, it should not cause any dangers, unless the unconnected negative side of the primer transformer gets shorted to the housing


Update to the first point: please consider the comment of Justme:


  you can experience the tingling or shocks because the power supply
  mains input EMI filter needs to be grounded or the metal case floats
  at half mains supply via filter caps