I think there will be plenty of work for a while because manual labor - construction, healthcare (doctors, nurses), food preparation, tradespeople - will be hard to replace in the foreseeable future.
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.