I think you need to specify the "position" of your stat_*().
library(tidyverse)
(plt = iris |>
pivot_longer(-Species) |>
ggplot(aes(x = Species, y = value, color = name)) +
geom_violin())

plt + stat_summary(fun = "mean", geom = "crossbar")

plt + stat_summary(fun = "mean", geom = "crossbar", position = position_dodge2())

Created on 2022-01-25 by the reprex package (v2.0.1)