I can confirm, AND have confirmed the exact cause.
It seems the Visibility check is not running correctly, it is centered on the block the golem is currently on, offset upwards by its eye height.
This rounds down, so if the golem is standing on any non-full block, like a chest for example, it will falsely start doing the visibility checks from inside the block it is standing on.
When the golem stands on top of a chest, or any block that is “higher” than its eye level, the visibility check is done from inside the block it is currently situated on, thus always failing and immediately closing the chest, unless of course the targeted block is the one it is also standing on.
The easiest solution is still centering the position in x and z, but also using the dedicated function on the entity itself for getting the y
eye level.
Note: Not for scale. This is roughly what is happening.