The last time something like this happened, it was a mistake.
On May 17, 2009, Tampa Bay Rays right-hander Andy Sonnanstine was scheduled to pitch. It was a home game, so the designated hitter was available. But by mistake, Sonnanstine’s name was written in Tampa Bay’s batting lineup, hitting third. Too late for the Rays to make a change, Sonnanstine came to the plate three times during his 5u2154 inning start, going one for three with a RBI.
It was the only time in the last 45 years a pitcher batted for himself in an American League game.