Q.What is wrong with my lavender?
I recently purchased it from a garden centre and repotted straight away, watering both the compost and the the lavender before repotting. The next day the heads began to wilt and on closer inspection some of the stems are turning dark green and some of the leaves are curling and turning brown.

A few things could be coming into play here. It could be transplant shock, overwatering or perhaps a little bit of both. Lavenders are very sensitive to being overwatered and actually prefer to dry out between waterings. The best way to determine when to water lavender is to touch the soil - if the soil is dry then it is time to water, if it is moist/damp then you should postpone watering.
Here is an article that will help you that discusses how to treat plants suffering from transplant shock after being repotted:
https://www.gardeningknowhow.com/houseplants/hpgen/repotting-stress-treatment.htm
For information on treating overwatered plants, please visit the following link:
https://www.gardeningknowhow.com/plant-problems/environmental/overwatering-container-plants.htm
For information on the care of lavender, go here:
https://www.gardeningknowhow.com/edible/herbs/lavender/lavender-in-the-garden-information-and-growing-lavender-tips.htm