That’s true, which is often a reason that people don't buy failing companies at all, instead buying selected assets (including things like the trademarks and brands) and letting the actual original company go out of business.
This can happen in bankruptcy, particularly, but that's not the only way it happens.
For unencumbered assets I don't see why not, but extending this logic to the brand seems fraudulent: It's unlike other assets because the (original) company crafted it to represent the whole service in the mind of the customer.
I’m curious to know what the announcements to existing customers said when they were transferred to the new company. I doubt it read: “the company you signed up with is bankrupt, but we cherry-picked its assets - want to go with us?”