It happened to me three times, in three different ways.
Once, as the caterpillar, I jumped off a branch and fell to the one below, but sank below the surface. I couldn't move and the camera was shaking.
Another time I formed a chrysalis on the underside of a branch, next to a curve in the branch which essentially made a wall to my left. When I transformed into the butterfly, I could not move. My guess was that I spawned too close to the vertical section of branch to my left.
The last time was while flying around as the butterfly. I flapped my wings and flew up into a branch from below, and became stuck similar to when I was the caterpillar.
Hope this helps!