Switching from straight to dpns

I’m knitting a cap for my granddaughter. The brim is knitted on straight needles and after 2 inches I’m to change to dpns. I’ve done this twice (had to rip back 2 times) and can’t figure out why I keep having an ugly gap in one area. Any thoughts?

The brim is knitted back and forth, correct? I think what you need to do is, when you finish the hat, seam up the gap.

Are you knitting flat, and then moving to in-the-round with the dpns?

You just knit off the straight needle onto the dpn…knitting the appropriate number of stitches onto each dpn as you go. If you sort of tighten up the first stitch or two as you change needles, the gaps should disappear.

you could also just bite the bullet and go straight to knitting it in the round on circulars.

That’s what I did when I knit Robin’s Egg Blue Hat. Just use circs instead of DPNs. But make sure you pull the yarn where you joint together.
Best of luck Crossed Fingers