I believe all birds, and definitely some, have genes for growing teeth. They're just "turned off". In fact, they've successfully grown birds with teeth in the lab by manipulating these existing genes.
Not to mention that there were “non bird” dinosaurs with beaks. Thus, a common adaptation to specialized feeding.
"The bird belonged to an ancient group of toothed birds called Enantiornithes, which went extinct along with the dinosaurs. This reconstruction captures the hatchlings pose as preserved in the amber."
From Wikipedia...
Enantiornithes is a group of extinct avialans (birds in the broad sense), the most abundant and diverse group known from the Mesozoic era.[4][5][6]
Almost all retained teeth and clawed fingers on each wing, but otherwise looked much like modern birds externally.
Over 80 species of enantiornitheans have been named, but some names represent only single bones, so it is likely that not all are valid.
Enantiornitheans became extinct at the CretaceousPaleogene boundary, along with hesperornithids and all other non-avian dinosaurs.
Enantiornitheans are thought to have left no living descendants.