17Goku was not brought back in the Buu arc due to fan demand
During the Cell arc, Gohan appeared to do be doing well in terms of characterization and popularity. After a time skip following this arc, he became the main protagonist with the introduction of the Buu arc, replacing Goku. However, near the end of the this arc,
the deceased Goku resurfaces, ultimately defeating the titular antagonist and saving the day, while Gohan has trouble defeating Buu and gets absorbed into him.
Many fans believed Toriyama brought back Goku due to fan displeasure with Gohan, but Toriyama himself had admitted that the choice to bring back Goku was simply for storytelling purposes. According to him, Gohan just wasn’t working out as the central protagonist. Toriyama said he was “not suited for the part,” which resulted in him bringing back Goku as series’ main protagonist.