Ok - I think I fixed this. It was a design/coding fault on my part (not a RAK811 issue) but I’ll post a brief explanation in case it helps someone else.
The application (on a RP2040) has an interrupt service routine (ISR) that includes a clock read. Either the clock read was slowing the ISR down, or it was, maybe, latching (or doing something odd) to the timer.
If the ISR was triggered at the same time as communicating via the UART, the link was getting messed up enough for the RAK811 to start generating the ERROR 5 responses.
The ISR was running on a separate core to the communications with the RAK811, which suggests to me it was the routine to read the hardware timer that was the issue.
Anyway, I cleaned up the ISR to read the HW registers directly and the ERROR 5 problem stops.
Incidentally, I shortened the message to 20 bytes and this reduced the frequency of the error (presumably because the comms window was shorter and the chances of the interrupt happening were lower).
I also tried slowing down the UART (9600 baud). That made the issue worse (more frequent). Presumably because the comms window was longer.
Thanks for the suggestions - they helped me pinpoint what was going on.