Why would a tumor grow teeth?
Search “teratomas” for your answer.
Some sort of weird mutation I guess.
More on the subject here:
https://www.google.com/search?q=teeth+tumor&ie=utf-8&oe=utf-8
Archaeologists excavating a gothic church graveyard in Lisbon, Portugal, made a discovery for the annals of medical history: an ovarian tumor that had started forming teeth.
Today, doctors know that this type of cyst, called a teratoma, is the most common tumor that occurs in the ovaries. But scientists are just starting to learn about past teratoma cases thanks to new evidence from the archaeological record.
A teratoma, which essentially translates as monstrous swelling from Greek, can occur when cells that should become eggs start multiplying abnormally and form mature tissues like hair, teeth and bones. [25 Grisly Archaeological Discoveries]...
https://www.livescience.com/59293-tumor-with-teeth-in-gothic-graveyard.html
The teeth and tumor thing is separate from the case of early birds having teeth. Or modern birds retaining the genes for producing teeth.