When delayed_retry is enabled and the following SQL is executed:
If the slaves have larger server_id values than the master, they will execute the SET statement slower. This means that the INSERT will be started on the master before all of the results have been received from the slaves. If the master fails before the INSERT completes but after at least one slave has responded to the SET command, a debug assertion will be hit.
This is happens because RWSplitSession::manage_transactions unconditionally erases the query without checking whether the backend in question is the one where the query was being executed on (implied by backend->has_session_commands() being false).
In non-debug versions this would manifest as a failure to retry the query even though it should've been possible. An error would also be logged stating that readwritesplit was not expecting this state.