I also had this problem with my 2012 Avensis. The doors wouldn’t lock with the fob but the boot did lock. If I locked manually with the key then unlock worked fine with the fob for the door and the boot. Same issue with the internal locking button on the drivers door, unlock worked but lock didn’t.
Two days ago i started repeatedly pressing unlock, then lock, unlock, then lock..... on the locking button on the drivers door. After about 10 seconds the doors locked. Since then it’s been locking as normal with the key fob.
Its only been two days and the problem might come back but it’s worth a try for anyone else that has this issue.