What were you trying to do that didn't work?
Can we consider below patch (I am the author):
This proposal is to include the syslogging feature whenever TMOUT logic sends ALRM and logs out the bash session. This will be helpful to track down what caused user session to end especially when there are multiple mechanisms to auto logout user session like systemd-logind timeout, pam, etc.
Attached is the patch for reference.
https://savannah.gnu.org/patch/?10542