What is the problem?
If on the Special:Block form you check "Editing their own talk page" without also checking "Editing" (like below), the user/ip is not blocked from their own talk page.
Looking very briefly at the code perhaps the issue is around this line of code: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/master/includes/block/AbstractBlock.php#591
Steps to reproduce problem
- Block a username, IP or IP range, with settings like the above screenshot
- Login as the blocked user or access the wiki from the blocked IP
- Go the the user's or IP's talk page and click "Edit"/"Create"
Expected behavior: User cannot edit, is given a message telling them they are blocked.
Observed behavior: User can edit page.