If AGI resulted in software engineer employment getting wiped out, that would not result in governments introducing UBI, no.
I have my doubts that the people owning AGI would allow the rest of us to make money from them, when they could make money from them instead.