It seems that the problem is fixed in LLVM 16.0.2 - https://discourse.llvm.org/t/llvm-16-0-2-release/70107
I can still follow up if needed for a bug report. I was having problems getting a reproducer because the command line tool did not support -flto=thin, now it does so I could perhaps now if needed.