I see UBI as a solution to inequality (real problem) not as a solution to lack of jobs (not a problem). AI will probably lead to reduction of inequality and therefore there will be less need for UBI.
In theory, the "mental" workers who get replaced by AI could simply move to manual jobs and total production and average wages would go up. But they may not like it, at least I wouldn't.