Minimal reproducible example is here:
library(ggplot2)
vals <- c(10, 12, 13, 20, 21, 28)
err <- c(0.85, 1.2, 0.9, 1.35, 2.2, 0.98)
cat <- c(rep("A",3),rep("B",3))
df <- data.frame(vals, err, cat)
df$cat<- as.factor(df$cat)
ggplot(df, aes(x=cat, y=vals, fill=vals)) +
geom_bar(stat='identity', position='dodge') +
geom_errorbar(aes(ymin=vals-err, ymax=vals+err), width=.1)
This code returns a plot like this:

however I expected two columns next to each other per cat. Closer to this:
What am I doing wrong here?

"dodge". One option is to switch to using"dodge2". Alternatively addgroup = factor(vals)into your globalaes()so dodge knows the categories to dodge on. I think the latter might be easiest if you are going to added the dodged bars