The Riddle that Never Was by Enid Blyton
Katie and Nick idolise their Uncle Bob - he's a private investigator and solving riddles is their favourite thing to do. So when he comes to visit, Nick and his friend Mike invent their own mystery for him, which bizarrely starts to come true and leads to a scary adventure at the hands of local bandits.