I had this problem too with the latest boot.dat (3.1.0), but using SX Gear's boot.dat/boot.ini redirection to payload.bin (fusee.bin or latest hekate then loading fusee.bin) the error is gone.For those of you who are still finding this error 'failed to run tsec keygen firmware'
this seems to only occur if your booting from hekate and/or sxos chainloading.
if you use tegrarcm and load the fusee bin from latest release it will work without getting that error.
SciresM made a comment that said that sx gear shouldnt be used. I was using sx os to load hekate and then atoms and with the latest update it causes this error. hopefully this will get fixed so I wont how to use a computer to inject a payload. Does anyone else have methods of injecting a payload similarly to using the sx dongle?
I use the same configuration on my unpatched Switch and a Switch Lite with SX Lite chip.