Turnips will bolt to flower when conditions are not right. They might have got too dry, or too much of a setback when transplanted. Root crops like turnips are best sown straight into the ground.
The most likely cause of your turnips flowering before developing good bulbs is that the temperature dropped below 5ºC (40ºF) over a series of nights fairly soon after they were transplanted followed by warmer weather.
This can be a signal to turnips that vernalization (winter then spring) is happening and triggers the development of flowering stems.
Normally turnips are biennial and grow leaves and swollen roots the first year, and the next year after a cold winter they reproduce by flowering in spring. But if adverse weather comes with near freezing temperatures which mimic winter vernalization, turnips, especially vulnerable transplanted seedlings, are likely to flower in their first year.