Artificial intelligence worries have shaken the market for software-company loans, fueling sharp declines and renewed concerns about credit risk. But investors aren’t treating every company the same, ...