This was observed in https://commons.wikimedia.org/wiki/User_talk:Zhuyifei1999#Embedded_Data_Bot_and_a_race_condition (the bot is for T129845)
The relevant logs on pywikibot's side:
Executing delete on [[commons:File:Copie de Copie de Copie de Copie de 001 Breaking And Bad 29.png]]
Sleeping for 0.8 seconds, 2018-06-12 17:00:13
WARNING: API error lockmanager-fail-acquirelock: Could not acquire lock for "mwstore://local-multiwrite/local-deleted/m/c/z/mczsju0t6qf7cm0a3qf6ylct0dh93bg.png".
API Error: query=
u"{u'maxlag': ['5'], 'title': [FilePage(File:Copie de Copie de Copie de Copie de 001 Breaking And Bad 29.png)], u'format': [u'json'], 'reason': [u'This file contains [[COM:CSD#F9', u'embedded data]]: After 145.6KiB (149053 bytes, via Ending,Magic): Identified type: application/x-rar (RAR archive data, v4, os: Win32)'], u'assert': [u'user'], 'token': [u'REDACTED+\\\\'], 'action': [u'delete']}"
response=
{u'servedby': u'mw1344', u'error': {u'info': u'Could not acquire lock for "mwstore://local-multiwrite/local-deleted/m/c/z/mczsju0t6qf7cm0a3qf6ylct0dh93bg.png".', u'code': u'lockmanager-fail-acquirelock', u'help': u'See https://commons.wikimedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.'}}
WARNING: Failed API request on attempt 0
Sleeping for 0.7 seconds, 2018-06-12 17:00:14
WARNING: API error internal_api_error_LocalFileLockError: [Wx-8HwpAEDEAACTVNM0AAAAH] Exception caught: Could not acquire lock for "mwstore://local-multiwrite/local-public/7/76/Copie_de_Copie_de_Copie_de_Copie_de_001_Breaking_And_Bad_29.png".
ERROR: Detected MediaWiki API exception internal_api_error_LocalFileLockError: [Wx-8HwpAEDEAACTVNM0AAAAH] Exception caught: Could not acquire lock for "mwstore://local-multiwrite/local-public/7/76/Copie_de_Copie_de_Copie_de_Copie_de_001_Breaking_And_Bad_29.png". [servedby:mw1284]; raising
MediaWiki exception LocalFileLockError details:
query=
u"{u'maxlag': ['5'], 'title': [FilePage(File:Copie de Copie de Copie de Copie de 001 Breaking And Bad 29.png)], u'format': [u'json'], 'reason': [u'This file contains [[COM:CSD#F9', u'embedded data]]: After 145.6KiB (149053 bytes, via Ending,Magic): Identified type: application/x-rar (RAR archive data, v4, os: Win32)'], u'assert': [u'user'], 'token': [u'REDACTED+\\\\'], 'action': [u'delete']}"
response=
{u'servedby': u'mw1284', u'error': {u'info': u'[Wx-8HwpAEDEAACTVNM0AAAAH] Exception caught: Could not acquire lock for "mwstore://local-multiwrite/local-public/7/76/Copie_de_Copie_de_Copie_de_Copie_de_001_Breaking_And_Bad_29.png".', u'code': u'internal_api_error_LocalFileLockError'}}
WARNING: Failed API request on attempt 1AFAICT, the deletion hash is calculated by sha, so if multiple files with the same sha are being deleted at the exact same time, the move target uri gets locked by one of the deletions and end up successful. The other deletion fail to lock the target, but locks the source without unlocking it (till the TTL expires, default = 2 hours).