Ghost call when cancel request didn't recieve a 487 back for outbound dial

Hi In Asterisk 20.9.3, I found a strange issue of getting ghost call from Asterisk after the caller ended by the caller.

When a caller hung up during a ring group scenario, Asterisk would send a CANCEL to the remote endpoint. If the remote endpoint failed to respond with a 487 (e.g., due to network disconnection), the CANCEL transaction would eventually time out. At that point, Asterisk would incorrectly attempt to send a NEW outbound INVITE to the next SRV address—even though the user had already hung up and the session was terminated.

This violated RFC 3261 Section 9.1, which states that if no final response is received after CANCEL within 64*T1 seconds, the client should consider the transaction cancelled and destroy it, not retry to another address.
*
created a fix for the same, I am seeking from experienced devs this approach is feasible or not.
It is tested and working for the raised issue.