There's nothing wrong with this. It happens all the time under other types of insurance.
In this particular case, the insurance carrier for Company A and the insurance carrier for Company B could be covered under simple contractual agreements for overlapping coverage. Maybe the carriers split the premiums that are paid for the first two years, and they have an agreement to split the cost of treatments that began when the insured worked for Company A.
I am a bit of a novice insurance wise: where else does it happen under other types of insurance?
Cars?? Homes? Appliances?