Dense, clay-ey soil that’s slow to drain and full of clods tends to obstruct the roots from growing straight down. Small stones and thick roots (from nearby trees, for example) may also force carrots to divert and grow around them.
The simple solution is to remove little rocks as you find them and work on improving your soil as carrots grow best in sandy loam.
It’s not an instant fix, but adding a few inches of compost twice a year before planting (in early spring and late summer) helps loosen the soil and stimulate the network of microorganisms, worms, and arthropods (collectively called the soil food web) that breaks down organic matter and creates humus.
You don’t even have to dig it in; I apply compost as a top dressing around my plants and let it seep in naturally over time. (Compost also makes a great mulch.)
Heavy compacted soil can also happen if you tend to walk on your garden beds, which compresses the soil around your plants. If your native soil is particularly bad, you might want to grow carrots in raised beds instead (where you have better control over the type of soil you put in).