I checked whether it had an invisible outline or not, and it doesn't, so I'm afraid there's no way to fix that. I'd recommend staying as far away from the moving rectangle as possible when passing through that section to be as safe as possible.
In my experience hitboxes are ok most of the time, and if they're weird I guess it's because of the animations.