It’s been a debate between Muslims and Christians on this verse, the Christians claim that Mary was not part of the Trinity hence thinking the Quran is false. But there is more to this verse than meets the eye.
The Quran here doesn’t talk about the trinity but rather the Collyridians, who were a heretical Christians movement which worshipped Mary, as a goddess.
Even though there were no Collyridians during the time of the Prophet (Saw) the Idea of the divinity of Mary may have still been a little prevalent.
There has been a Hadith which has been said that when the Prophet (SAW) marched to Makkah. He found images of Mary,Jesus and Abraham but this is seen as a fabricated Hadith
In short the Quran verse mentions a heretical Christian group that worshipped Mary.
Asalamualaikum warahmatulah wa barakatuhu