OK Im not an expert or a local but have in laws nearby-ish
Its the Peak District so hills are unavoidable
Best option to “avoid” them from Castleton and stick to quietish roads would be:
Head east on valley floor in tight formation to Hathersage
Turn right at village and ride south for about 1km till you get to the Plough where there is an awkward right turn on a crest
Follow this through Abney and past the gliding club, on the descent take a right at the T junction towards Hucklow then look for a snicket from here to the B6049 heading to Tideswell
Cross the A623 and head into Tideswell then carry on to Millers Dale where you need to turn right in the valley floor up to Wormhill
After the Wormhill climb head towards Peak Forrest, cross the A623 again and steer NWish through Perryfoot Dale to the end, turn right heading to Castleton again and either kamikaze it down Winnats to where you started or errrrrr kamikaze it down Mam Nick to Edale then back round to Castleton
Total distance about 55km, vertical climb 800m which is pretty wussy by my Peak District experience
🙂