This is also broken for me in 1.12.2, but appears to be fixed in 18w02a.
I have MB4/MB5 mapped to inventory slot 8 and 9, respectively, and my test case is sneaking (on a ladder, the edge of a block, etc) while clicking MB4 to choose slot 8. This selects slot 9 in 1.12.2, but in 18w02a it correctly selects slot 9.
Thanks for linking to the other bugs. My problem looks very similar to MC-43601, as there are mobs are next to me behind a wall. Let me try moving farther away to see if the problem disappears, and I'll report back in a few minutes.
This is also broken for me in 1.12.2, but appears to be fixed in 18w02a.
I have MB4/MB5 mapped to inventory slot 8 and 9, respectively, and my test case is sneaking (on a ladder, the edge of a block, etc) while clicking MB4 to choose slot 8. This selects slot 9 in 1.12.2, but in 18w02a it correctly selects slot 9.
Maybe this is related to the LWJGL version bump?