I did some testing and conclude the issue is once updating from android 12 to android 13, the secdata on device gets corrupted. It is not the internal memory or TWRP or sysyem issue but only secdata mismatch.
Easy way I did was to boot into fastboot mode and format secdata using command...