Postmodern authors like Kurt Vonnegut in "Breakfast of Champions" and Milan Kundera in "The Unbearable Lightness of Being" introduce themselves as characters or narrators in their works.
In the Theater of the Absurd, playwrights like Samuel Beckett in "Krapp's Last Tape" and Eugène Ionesco in "Exit the King" incorporate elements of self-reflection and self-exploration through characters who bear similarities to the authors themselves
An interesting example is "The Power of Yes" by David Hare, subtitled "A dramatist seeks to understand the financial crisis", a documentary play with real-life character. One character is called 'the Author', but it is clearly David Hare himself.
In some contemporary female-authored rewritings of the classical tradition, we can find two clear contexts in which the author--the Roman poet Virgil--is a character in his own work--the Aeneid--and even converses/interacts with his own creations. See my articles "'A dream within a dream': liminalidad y creación poética en Lavinia de Ursula Le Guin y El silbido del arquero de Irene Vallejo" (2020) and "Hopes Woven in Smoke: Reimagining Virgil’s Aeneid in Irene Vallejo’s El silbido del arquero" (2022).