Do not confuse "dogma" with what the first Christians actually believed and passed down. The Church "Fathers" wrote that Mary was the second Eve. Eve, of course, was without sin. Irenaeus
"Thus, the knot of Eve's disobedience was loosed by the obedience of Mary. "What the virgin Eve had bound in unbelief, the Virgin Mary loosed through faith (Against Heresies 3:22:24 [A.D. 189]).
Many of the councils were called to combat heresy. They did NOT just think up the stuff while they were there.