There are several places in the Talmud, where rabbis alter the reading of a Biblical verse to teach something. an example of this is:
Berakhot 64a (Sefaria):
אמר רבי אלעזר אמר רבי חנינא תלמידי חכמים מרבים שלום בעולם שנאמר (ישעיהו נד, יג) וכל בניך למודי ה' ורב שלום בניך אל תקרי בניך אלא בוניך
R. Eleazar said in the name of R. Hannina: The disciples of the wise increase peace in the world; as it is said, "And all thy children shall be taught of the Lord ; and great shall be the peace of thy children" (Is. liv. 13). Read not banayik "thy children" but bonayik - thy builders
Granted that the verse, above, is from Isaiah and not the Torah. However, I believe that the changing of pronunciation is used in verses from the Torah, as well. (Can't locate the example at the moment.)
Aren't the words and pronunciation Masoretic and the correct pronunciation should not be changed? I understand that in Hebrew, the vowels are not written, so the concept that the rabbis are using is within the freedom that since there are no vowels, it "could" be pronounced in some other way.
Nonetheless, how do the rabbis have the permission to alter the pronunciation since that was not what was originally meant? Also, what prevents any rabbi, currently, or even a wise student to alter the pronunciation of any word from anywhere in the Bible just to accommodate his idea or teaching? Is there some leniency in using this technique with other sections of Tanac"h outside of the Torah?