Retrieve modbus error code in Zeek event

How can I modify the event to make it work with my use case ?

It seems you have made progress since you asked this. Lets continue discussing in your follow-up: