Hi,
The Audit Detail records are not processed linear in a policy meaning.
When the add audit details are there the assertion is not immediately written to the DB thus giving all of audit information.
All of the audits are stored and written post policy processing which will make it unlikely that the record ID is available for use in a customize error response. Since the customize error response technically occurs in processing prior to the audit sink policy. So you may be able to get some details using the last variable,
audit.details.last.xxxxxxx like audit.details.last.fullText
For example if the last audit is the audit from the failed route via http for example,
But I do not believe all details will be available in the .last because of the audit.sink processing has not occurred yet.
I hope this helps.
Thanks