John’s Gospel indicates that somehow the Jewish authorities knew that Jesus had not received formal rabbinical training, and they were using that against him to challenge his authority to teach. It would not have been unusual for his followers to call him Rabbi as a courtesy and in a non-technical sense, despite his lack of such formal training. (I agree that he hardly needed it.)
John 7:15 is quoting the crowd of visitors who are hearing him for the first time. Like the rest, they are astonished. They say he is ‘learned’ without having ‘studied’ = ‘discipled’. They go on to call him demonised! Do you accept that too? If not, why accept the other at face value?
They were reacting in astonishment to someone who was, very unusually, not teaching in the manner of a disciple, which was unheard of.