Can't write tags to file that I can rename in WE

I have a file (m4b audiobook) that I can't tag. I just get the message 'can't open file for writing' yet I can rename the file in Windows Explorer. After checking the file (it was read only) I corrected read and permissions, restarted Win 10, installed the latest MP3Tag, scanned the drive, installed and used an unlock program on it and still can't tag it. I have had issues recently where randomly tagging an album, I would have a similar issue with one file not writing then would write when I ran the action a second time. Any suggestions on what else I could look at?

There are other files in the same drive and folder with the same issue and some with no issues.

Edit 2:
I have previously tagged these files and moved them several times around my home network and am trying to retag differently to match a new scheme.

Edit 3:
I was able to edit tags in AIMP (Portable Version) but not VLC. Once I change a tag in AIMP I can then write tags to that file in MP3TAG

See e.g here:

Renaming a file has nothing to do with writing metadata into the file..

Okay. It seems to be a file integrity issue. I forgot Foobar2000 has an MP4 integrity checking utility and all the unwritable files seem to have integrity issues. Something in saving tags in the AIMP app must fix the worst of the issues but it seems to be something to do with the chapter marks in the m4b file as the integrity utility says the reported chapter lengths are wrong. I'll need new copies, it looks like.

For anyone who is interested in the future. If I strip the chapter marks (using Foobar2000 utility) I can write tags in MP3TAG. In my files, running the integrity checker a second time finds no errors. It might help someone who can't access a replacement file.