What most people don’t realize is the New Testament books were written to push a sects ideas and then later books were written to destroy that idea etc.. One example is their was a sect that believed the Christ was a Seperate deity to Jesus the man and at his baptism this Christ entered into his body ie the Dove. Then when Jesus died the Christ left him ie” why have you forsaken me?!” 1john was later written to refute this idea.
The trinity was much the same, different ideas to the nature of Jesus and finally ended up with some what of a trinity by 325 and then refined more after.