I occasionally had problems to boot an OS immediately after an OS restore by TWRP, too.
What always helped me in this case was simply installing the fitting OS version again over the restored state of the installation.
(Was mostly LineageOS, though.)