Also, no, it doesn't predate. Or at least, there is no such record of it. What are your sources?
There's free food, and then there's langar. The scale, quality and motives are just so different.
https://news.tirumala.org/nitya-annadam-free-meals-for-all-2...
more stats here
https://www.tirumala.org/SRIVENKATESWARAANNAPRASADAMTRUST.as...
Anna prasadam is pretty common thing in Hinduism. Read about Akshayapatra foundation which provides free mid day meals to 1000’s of children every single day!
Steve Jobs would walk 7 miles every Sunday to have lunch at Hare Krishna Temple
And it's usually the result of you having attended a prayer, rather than "we'll feed anyone a full meal"
The closest thing Hindus do is the Hare Krishna templates globally that also feed anyone who shows up.
Also temples are extremely diverse and probably less than the 1% of temples offer wholesome meal Prasada similar to Langar while a Gurudwara most certainly will offer Langar.