Thanks for digging further into it. The change was done to avoid looping back to the same function if the `log_custom` was set as custom logging backend in the core. However, if udp_send() fails for first message, likely to fail for saying the previous execution step failed. So I changed that to printing to stderr directly, just to have a way to try to troubleshoot such cases.
And indeed, send_udp() returns the value of the sendto() and should be positive in case of a successful operation.
The fixes are in master and 5.4 branches -- reference commit: f16d046f6330f897b374d9bb7dab3b2ce8eab3a7 .
Test and if still issues, reopen.