The snake breaks through if it cannot find a path to the player. Perhaps it got stuck with it's tail on the other side or smth and decided to do that? One other person did report it breaking through without reason, so it might've been a bug
Thanks for the feedback!