The time pressure of a manned mission is significant - this ability to make decisions quickly is only necessary because of the time constraints of a manned mission and the need to be careful enough to get back. This time pressure can be a factor in making mistakes and irrepairably damaging the instruments or hardware you brought. In one instance, Apollo crew has destroyed a camera they brought by accidentally pointing it into the sun for example.
The flexibility of humans does not give any significant benefit if those humans don't have the time to use it. When every minute is planned for something, with some buffers to make mistakes, your ability to improvise only comes in to remedy your mistakes. And some are not fixable. The operation is exciting and all rests on the ability of 2-3 people and the preparation of dozens and their skill under time pressure.
A robotic mission has months to remedy some fuckups and come up with workarounds. Some things are not fixable either. But a robotic mission has all the knowledge of a team of experts and is not put on the spot - they don't need to be as superhuman. The operation is comparatively boring and rests on the ability of dozens of scientists and engineers. They don't have to prepare for contingencies as much, they can analyze a situation, compare plans, simulate consequences (such as software patches, hardware operation) and act on them.
Take for example the lunar rover fender that broke, and they patched together a solution on the spot. And compare that to the Insight Lander mole, which found a particularly hard-to-drill rock and can't move from the spot (after all, it's a lander, not a rover). Now they are trying to push it with the landers arm, but there's only so much that can be done.
This is where the real advantage is. Intuitive curiosity is not something AI is anywhere near being able to replicate in a useful way. Plus being able to explain why something is interesting and worth investigating. Look at image recognition- even where it's extremely accurate, in the instances where it screws up, we topically have no idea why. (Like confusing a leopard with a hair brush.) Which in the context of exploration is not very useful. If we don't know why the AI finds a feature interesting, then how are we (or the AI itself) supposed to know what to do about it? How to further study it?
Every other comparison between humans and robots is somewhat debatable depending on context and mission.
Secondary is certainly reaction time, especially in the context of timely investigation. As someone mentioned elsewhere with large scale drilling, many types of equipment still require a human operator with near-realtime feedback to be used effectively and efficiently in a non-specialized manor.
If a rover on Mars rolls around a boulder and spots a little green man, or a pink Martian rabbit, they're probably not going to hang around and wait to be studied. More likely, it might dig a hole, uncovering water or some other unknown material that's evaporated or sublimated before it gets instructions on how to react. Of course if it's a pink martian rabbit, we'll have to wait 8-12 years to develop and delete a new rover with trapping capabilities. :-)
Where humans excel is on the spot decision making: looking around and saying "that looks interesting, I'm going to ignore the mission plan and go over there instead". That is where great breakthroughs are found, but it is also where mission control gets mad because the important things everyone was interested in don't get studied for something pretty but otherwise uninteresting.
We know from earth that there are some interesting geographical features that are only a couple meters wide: such features on mars would not be visible from earth. Thus whatever is on mars needs to recognize interesting things and find it. Humans intuitively recognize interesting things (and do better with just a little training). Teaching computers to recognize such features is a hard, partially unsolved problem.
On the moon you can do remote control of robots from earth and get the same level of power from a robot if you want it. (do not read can as we should - there are reasons to not do remote control) You can't do that on mars unless you are working at a speed of meters/day, so whatever is on mars needs to have local control to decide how to get around and what samples to get.
Robots generally do best for solved problems. A factory can replace 100 humans with saws with two robots and get more accuracy, but the shapes being cut out of a flat sheet of steel of a standard size. When you only need one part it is often faster to have a human with a saw cut it out (this is less and less true as the design to part chain gets better).
The truth is there are advantages to both.
At the current state of technology humans can do more than robots. However robots are enough cheaper that we use them anyway: we still don't have the ability to get anything back from mars. Ethically we will not send humans on a one way trip with enough supplies to live on mars for two weeks and then die, so humans are not an option yet.