When I was playing around with hitboxes, I built an iron golem.
I noticed that it's legs were right in a block, and it could walk through it (see first screenshot).
Then. I built a two-block-high wall and hit an iron golem into it. Of course, it went right through (see screenshot 2).
Strange.
Probably intended. The hitbox of the iron golem and the block overlapped. This is the same if you stand half inside a block, you can still move out of it.