I deal with these situations all the time at the baggage service office. The terminating carrier is 100% responsible. This summer, I've had to provide baggage service to dozens of other-airline-IROP customers whose bags were never given to Delta and the customer never told Delta he had a checked bag. But since the customers arrived at their final destination on Delta, Delta is responsible for baggage service. Avianca refusing a claim does not relieve Avianca of responsibility.
If a pax checked a bag with United on a United itinerary at ORD, then has an IROP mid-trip and gets rebooked to Delta, but the bag never leaves United in ORD, that doesn't mean United has to take the claim. Sure it's United's fault, but the ONLY relevant question is "Which airline did you JUST arrive with? They'll take the claim."
Because what happens if you get rerouted to somewhere United doesn't even fly?? You wouldn't even be able to file a claim if you tried because United doesn't operate there! That's just one reason why the final carrier does all baggage service, no exceptions.