So company A gambled that they can turn around company B in 12 months or go bankrupt? Sounds like whoever decided to buy didn't do their due diligence.
Not necessarily bankrupt but at a point where they’d have to cut their losses by losing staff. But company B was going to be fully bankrupt before 6 months without company A stepping in.
Companies make these decisions all the time, particularly in industries whose products are hit driven and then tail off.