The doctor didn't order 38.5 tablets -- at least she didn't think she was. She thought she was ordering a dose per kg, not a quantity of tablets.
You say the screen is very clear. It's clear enough when I read it. I had a good night's sleep and I am alert and awake. I've been primed by the article to look for the error. I imagine I would easily miss the mistake if I've been working hospital wards for the last 10 hours on a rolling nightshift, looking after some very ill patients.
The fact that it's possible to use two entirely different dosing systems to order medication and have the screen not clearly indicate[1] which is being used is so obviously sub-optimal I'm kind of surprised to see anyone saying that it's "just pilot error".
Actually, she thought she was ordering a single dose at 160mg, and accidentally ordered dose per kg. 160 was the size of the dose, so the patient's weight became the number of pills.
If the doctor is used to working with older/larger patients (over 40kg) they might get that screen only rarely, and perhaps because the patient was so close to 40kg, she wasn't thinking in "pediatrics" mode, and expecting it to come up.
When you routinely get prompted with that question dozens (hundreds?) of times a day, it can't elicit that response successfully. It's just not how our psychology works.
The UI screenshot in the article makes that mistake VERY clear, and their "are you 100% sure" question is obviously intended to illicit a particular response (who is ever really 100% sure of anything?).
I know this article is about how systems can be altered to protect patients, but much like with the NTSB's findings, sometimes it legitimately is pilot error (or doctor error in this case).
Can things be better? Yes. Absolutely. But so can doctors. These types of systems are stop-gaps, without them this doctor could have calculated the wrong dose by hand and made just of large of a mistake.