The imperial dynasty was overthrown in 1911, when Yang Chengfu would have been around 28. I doubt he would have been old enough to hold a prestigious teaching position during the waning years of the dynasty and probably would not have wanted one. My guess is the speaker just got mixed up. I have heard or read only that Yang Luchan and Yang Banhou had taught in the palace. Yang Chengfu was known, on the other hand, for popularizing his family's art at a time when strengthening China and its people was a common concern among Chinese concerned about the weakness of China in the face of foreign aggression and internal disorder.