If your collision polygons are different for each frame, then yes, this is probably the reason. When animation is playing, some frames collide with the wall and some don't, even when the character x,y position remains the same.
You can try "overlapping at offset" as justifun suggested, although I think it also uses character's collision polygon, so you may have the same problem only at an offset.
You can compare distance() between bounding boxes of your character and walls instead of collision detection. Or you can pin an invisible sprite with rectangular collision polygon and use it to detect collision with walls, ceilings etc.