Wordfence writes scan status to its own tables during a scan. When MySQL ends the connection, Wordfence cannot finish the write and aborts the scan. The termination happens because the server reaches its timeout, packet size limit, runs out of memory, or crashes.
The error appears as MySQL server has gone away and stops the scan immediately.