The photo reveals that the device uses a transformerless power supply design - fairly obviously from the lack of a transformer, and additionally the readily recognisable yellow "X2" capacitors plus the group of components on the right-hand side of the top PCB which are representative of those typically used in that type of power supply. If the device doesn't offer any (non-isolated) external electrical connections to its internal circuitry, the "ground" rail of the power supply does not need to be at Earth/Neutral potential and it would appear that this device indeed uses such a "floating" ground rail.
As is the norm the oscilloscope input "ground" is connected to Earth and when you attached the "ground" of your oscilloscope probe to the "ground" on the device you were effectively short-circuiting that "floating" rail to Earth/Neutral.
Had you monitored your scope after you attached your probe and before you connected your ground lead you may well have noticed what a large voltage was present on the probe.
What isn't immediately clear without knowing the specific design of the power supply is why the ICs were damaged. Presumably this is not a case of the circuit "ground" simply being tied to the Active line. It would make an interesting exercise to trace out the power supply circuit and see exactly how your ground connection led to the outcome you experienced.
It is a clear and important lesson not to make assumptions about what a "GND" is! That applies in any circumstance, but is all the more important when this type of power supply is in play. While not an exhaustive check, some simple meter checks (continuity check while disconnected, and both AC and DC voltage while powered) are always worthwhile between a known ground and a "suspected" ground. And if you've gone ahead and connected your oscilloscope's probe anyway, it's also worthwhile to check that there's not anything unexpected going on there.