For those unfamiliar with the term “diegetic music”, it refers to music that’s actually played in the story rather than just for the benefit of the audience. The characters can hear it too.
With that in mind, are there any musicals where the characters acknowledge that they’re constantly breaking into song? Buffy the Vampire Slayer’s “Once More with Feeling” is the best example I can think of for this.
A lot of stage and movie/TV musicals where the characters are actually singers have prominent diegetic elements - so Beautiful the Carol King musical, Jersey Boys, Elvis a Musical Revolution, The Commitments, Fame etc.
In the recent Star Trek: Strange New Worlds episode “Subspace Rhapsody” all the characters were aware that they were breaking into song, much like they were in “Once More With Feeling”. Which isn’t surprising as OMWF was a very clear influence on the Star Trek musical.