The KJV is wrong in its translation (why did you even reach for it?). My degree was in Ancient Semitic Literature. A better translation is the NRSV which is as follows:
Do not say, “Why were the former days better than these?” For it is not from wisdom that you ask this.
The proverb isn't about squelching inquiry, it's about squelching the belief that the past generation was better than the next. It follows a long litany of proverbs, in context, that describe how to accept the reality that has been given to you.
Yeah, because being inquisitive and asking questions is bad!