FYI, this looks like a neovim bug, I opened an issue here neovim/neovim#33780
I am creating this issue just in case people find the same issue on their end.
__prepare() functions were the reason why this bug was triggered in my setup.
Nothing wrong with the way ui.nvim is written as far as I understand.