For any field $k$, the ring $A = k(U)[[X,Y,Z]](X^2+X^3+UX^6)$$A = k(U)[[X,Y,Z]]/(X^2+X^3+UX^6)$ is a UFD such that $A[[T]]$ is not a UFD. For a proof of this, see
Salmon, Su un problema posto da P. Samuel.
For further developments, see the first two pages of
https://www.mathnet.ru/php/archive.phtml?wshow=paper&jrnid=sm&paperid=3365&option_lang=eng
(V. I. Danilov, On a conjecture of Samuel, Mathematics of the USSR- Sbornik, 1970, Volume 10, Issue 1, 127–137 DOI: 10.1070/SM1970v010n01ABEH001590)
as well as