The simple answer to your question, I believe, is "yes".
However there some options regarding 401ks. What I did was to roll my 401k into and IRA before I moved back. My son moved back from the USA 1 week after leaving work so he initiated the rollover before he left and it completed after he was here. The reason we both choose to do rollovers, which are tax free, is that the brokerage we chose was much more accommodating, and used to having, overseas customers, plus it gave us lower fees and a better choice of funds.
I will be in a higher UK tax bracket once I start receiving OAP, SS and RMDs from an IRA so I converted all my IRA money to a Roth IRA which has tax free withdrawals in both the USA and UK. I did the conversions over 10 years, the first 7 years of which I was still in the USA. Once in the UK I still did a single lump conversion each year for 3 years and those conversions were only taxed in the USA.