The cycle is poorly understood
The spice cycle was never fully explained by Herbert. Several points along the cycle are speculative, such as the exact relationship of the plankton to the worms. For example, we still have no idea where the plankton come from; them being produced by trout or worms is only ever implied by their presence on planets altered by trout. (See the image below for reference.)
The key oddity I noticed is that the sand worms seemingly farm their own species as food. This makes little sense from an evolutionary perspective due to the red queen hypothesis: predator and prey wage a constant evolutionary arms race. The worm's hunger directly competes with their reproduction, thus they would be pressured to cease consuming the plankton. The only way this could be stable is if the relationship is a highly refined symbiotic one, similar to (albeit more extreme than) the real life Dracula ants that are known to drink the hemolymph of their own larvae and pupae.
Not only that, but feeding on plankton would make the worm a filter feeder. This contradicts them being active hunters, which itself is infeasible. The worms are simply too big for active hunting to provide sufficient nourishment, and thus should be much more docile than the territorial predators seen in canon. Unless, as the novel suggests, they attack only to defend the spice and their offspring from other species.
These oddities could be explained by the novels' implication that the spice cycle is a xenoforming agent. In other words, the spice cycle is carefully fine-tuned to be utterly self-reliant in order to transform hostile environments into ones suitable for its own propagation.
Sand worms cannot feasibly be autotrophs
Herbert simply made a chemistry error. That's the only way I can explain it.
Dune states that the worms are "oxygen factories," which is where the Dune Encyclopedia got the idea that they were autotrophs. It is not feasible for the adult worms to be autotrophs because autotrophy does not provide sufficient energy to power animal metabolisms on macroscopic scales. Although some photosynthetic jellyfish and sea slugs have been discovered on Earth, they are quite rare presumably due to being inefficient compared to vegetative autotrophs.
The worms are described as having the biological equivalent of internal furnaces, which contradicts the statement about oxygen production because the process of combustion (and respiration) consumes oxygen. Realistically, they should be consuming oxygen rather than producing it.
The fact that the worms consume plankton in the first place would indicate they were heterotrophs, not autotrophs. Realistically, the plankton are the ones that would most likely be autotrophs.
The Science of Dune by Sibyelle Hechtel includes an essay that contradicts the canonical explanation and posits that the cycle instead gets its energy from hydrothermal vents, although it makes a number of errors such as forgetting about the sand plankton. It also posits, similar to the Because Science video on sand worm motion, that the sands of Arrakis have a special composition to make them easier to swim.
It simply is not feasible for the worms to perform oxygen evolution. This requires more energy than the worm should feasibly be able to acquire. Why would they evolve to do this when it is a complete waste of energy? They would not need to produce it for the benefit of the trout and plankton, since those organisms could feasibly produce their own oxygen by splitting it from water.
The simple fact that the worms react explosively to water indicates that their biochemistry is vastly different from terrestrial life. To even begin to explain that would require delving deeply into speculative biology and far away from Herbert's work. Herbert's explicit suggestion that the trout sequester water (and thus turn planets into deserts) specifically for the benefit of the adult worm only raises more questions about their undoubtedly idiosyncratic evolutionary history.
The real life condition aquagenic urticaria is the only thing that I feel could feasibly explain the disparity without resorting to complicated biochemical explanations. Rather than the worms not incorporating water into their biochemistry, they have to consume it in a packaged form that would not irritate their sensitive tissues.