There are verses in Samuel where Chana talks to Hashem after she got a child and says there no one as holy as hashem and there is no one but “you”. The subtle change in grammar could be learnt as chana teaching us how to become close to Hashem, ie he is the only one true source of everything including ourselves.
How do we know the words of chana of accurate and that the slight grammatical change isnt a mistake?
What makes you think that it is a “mistake”? Every time we make a bracha we switch the terminology from second person to third person. We say baruch ato (second person) and after that we say asher kidshanu bmitzvosav, vtzivanu which is in third person. The question though is why there is a difference in the terminology.
There is no chance that there is a mistake. Sefer Shmuel was written by Shmuel himself as the gemorah (Baba Basra 15a). Since Shmuel was a navi that means that whatever he wrote in Shmuel was on the level of nevuah. The Ramban (beginning of Parshas Vayiera) that the difference between Nevvim and Kesuvim is that Neviim was written with a revelation on the level of nevuah- From H-shem Himself, but Kesuvim was with a revelation of a malach. Being that Shmuel is on such a high level, it is not possible to entertain the thought that nevuah was a mistake. (Not that Kesuvim can chas v’shalom be a mistake, I only mean to bring out the point, that this posuk was written on a tremendously high level of accuracy).
Having said that, the idea you wrote as to the lesson learnt from the difference in the grammar is a nice idea.