This is a trope that arises from Real World AI research, not Asimov's stories (although frequently quoted).
The question at the heart of the problem is the moral and ethical philosophy the human race has been struggling to answer for over 2000 years. That is: what, objectively, is "happiness"/ "harm"/ "human"/ "alive"/ "good"/ "evil"?
It is very easy to define a set of rules that on paper look good, but which in practice are full of holes. For example, "alive" in the sense we mean it is some undefinable aspect of organic chemistry.
If I attempt to define it, then meat at the grocery store is alive (because on a cellular level, it still is: that's what makes it fresh) or sleeping people are dead. Or comatose people. Or (worst case) people under medically induced death as part of a surgical procedure. No, really, that's a thing. We routinely stop people's hearts from beating or keep them from breathing, while under the effects of general anesthesia in order to operate on those organs. From an objective point of view, these people are dead, they're just going to "get better" later.
In order to get to an Asimov level AI (which is imperfect, see: any of Asimov's books featuring robots) we'd have to solve an unsolvable problem.
Ergo any AI we do program is going to be imperfect and its failures will be spectacularly dangerous in one way or another. Computerphile has a great episode on this, which gives an AI the singular goal of collecting stamps.
While it does get hyperbolic ("what idiot would give a computer access to the machines necessary to harvest the carbon from humans in order to make more stamps?") it illustrates a point: merely being able to perform its assigned task, it will have some level of power that will not be desirable, and limiting that power inhibits being able to perform its task at all.
In the case of the HealthInsuranceBot, it comes down to having control over who lives and who dies (via access to medical care). It doesn't matter what the intent was, there is the potential that the power given exceeds "rational thresholds" which is impossible to reign in. The AI can declare "that man is 68 years old and a smoker, he's going to die in 2 years regardless of how much money we spend on him trying to keep him alive, according to my programming, he will only drive costs for everyone else up." Suddenly this person cannot get any access to medical care (not even to make those two years painless) and has been effectively sentenced to death, even if the AI itself didn't issue a death warrant. The utility function has decided that any care is too expensive, even if a rational human being would have done something to provide some end-of-life care.
On the other end of the spectrum, if you try to keep all people alive as long as possible, you end up with people in a persistent vegetative state eating up resources despite being (more or less) dead and will never recover.
In the gray area, there are cases that look black and are actually white (vegetative states that have recovered) and cases that look white and are actually black (rather than surviving 2 years with lung cancer due to a lifetime of smoking, they survive 10). No amount of predictive software is going to make those hard decisions easier, and as soon as the computer is given authority (final, absolute, recommendation, any authority whatsoever), those decisions are no longer seen as altruistic and the AI has become evil.