Why did it take five centuries from the appearance of the first European universities to the appearance of the first academies of sciences?

Universities were created to train applied professionals (doctors, lawyers, officials, priests). Professional theoreticians appeared (as loners) by the end of the XIII century (Thomas Aquinas, Roger Bacon, Raimund Llull). In the 16th century, the pace of scientific progress increased so much that professional scientists appeared who had no other sources of income.

Remember: The process of learning a person lasts a lifetime. The value of the same knowledge for different people may be different, it is determined by their individual characteristics and needs. Therefore, knowledge is always needed at any age and position.