(1) the size of needle was too large for the thread or the size of the thread was too small for the flannel. I actually tend to use at least a size 40/2 thread (or 50/3) with flannel because the brushing tends to cause more spaces between the fibers. So if you switched threads or switched needles, that could well be part of the cause.
2) density of the fabric. All flannels are not alike. It depends on the width of the fibers & weight of fabric that they started with. Then it depends on whether it was brushed or double brushed, and what chemicals were added to the flannel. Some companies will pre-shrink the flannel before sale. Again, that process can vary greatly.
Thank you. I am going to study this

I don't want this to happen again