Here is a partial solution. The colors of the fit lines are not right but I think you know how to fix that. The main problem was with your attempt to summarize the data with ddply and chaining that to other functions with +. You cannot generally chain functions together like that. You can do that in ggplot2 but that is a special case. There is a pipe operator in magrittr, %>%, that can chain functions together and I used that and the functions from dplyr. I have not used ddply in a long time and I didn't want to wrestle with it.
a1 <- openxlsx::read.xlsx("~/R/Play/Data.xlsx")
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
Treatment.Sex = a1 %>% group_by(Treatment, Sex) %>%
summarize(meanQ1 = 100*mean(Q1,na.rm=T))
#> `summarise()` regrouping output by 'Treatment' (override with `.groups` argument)
Treatment.Sex$Treatment = factor(Treatment.Sex$Treatment,
levels=c("CONTROL","A","B","C","D","E"))
###Plot for Question Q1
library(ggplot2)
ggplot(data=Treatment.Sex,aes(x=Treatment,y=meanQ1,fill=Sex))+
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),panel.background = element_blank(), axis.line = element_line(colour = "black"))+
geom_bar(stat="identity",position=position_dodge(),colour="black")+
geom_smooth(aes(group=Sex, color = Sex), method='lm',se=F)+
scale_fill_manual(values=c("coral","cornflowerblue"))+
xlab("Treatments")+
ylab("Proportion of Correct Responses (%)")+
theme(legend.title=element_blank())+
ggtitle("Q1: Correct Responses by Sex")+
theme(text=element_text(size=16))
#> `geom_smooth()` using formula 'y ~ x'

Created on 2021-02-17 by the reprex package (v0.3.0)