https://phys.org/news/2022-10-teachers-girls-higher-boys-italian.html

The researchers then looked whether factors, such as the type of school and the size and gender make-up of classes, were driving the gender grade gap.

They also investigated whether characteristics of teachers themselves, such as how senior or experienced they were and whether they were male or female, helped explain girls' more generous grades.

Only two factors were found to have an effect—and only in maths. The gender gap in maths grades was greater when classes were bigger. Girls were also graded as being further ahead than boys in technical and academic schools than they were in vocational schools.

None of the other factors had any significant effect in reducing the gender grading gap.

According to the article they don't "have the answer" at all - they have a couple of theories:

The study's authors say it's possible that, in reading, teachers unconsciously reward students exhibiting traditionally female behaviour, such as quietness and neatness, which make teaching easier for the teachers. Another theory is that inflated grades in mathematics are a way of trying to encourage girls, who are often seen as weaker in this subject.