The DC side is fully isolated except through a capacitor that is there to reduce EMI interference and is specifically built to "fail safe", except for the cheapest no-name imported power supplies. (https://www.pcbaaa.com/y1-capacitors-function-application-an...)
That's not what the Y capacitor is doing here. All Y means is "high voltage withstand, will fail open, and we have receipts". Here, it's not line-to-ground, but primary-to-secondary.
You'd use X for L to L/N, Y is for N to Ground. Those isolated power supplies are definitley grounded, definitely not what Apple is using, and will probably shut themselves off if they lose their ground connection (or at least signal a fault to the operator)
You're also confusing the Y designation, which relates to the capacitor properties, to the application. Not all Y capacitors are used for line-to-ground applications. However any application where a failure to a closed state would result in a shock hazard must use Y-rated capacitors.