Don't be so sure it's unrelated. I ate gluten for the first 25 years of my life. I stopped eating it for more serious problems but, when I did, the knee pain I had since 15 also went away.
! My housemate ate gluten the first 55 years of her life. When she stopped eating it, the knee pain she had since 17 (and other problems) went away. No doctor ever suggested doing that.