The claim could be due to the presence of a complex world with its own rules. James Bond has the world of international espionage with its codes and protocols. Harry Potter has the wizarding world with magic spells and Hogwarts' own regulations. Also, both heroes are often in situations where they need to rely on their wits and skills. Bond uses his spy training, and Harry uses his knowledge of magic and the help of his friends to get out of tough situations.
There are several aspects that could lead to this claim. First, the idea of a journey or a mission. Bond is sent on missions around the world, and Harry Potter has his journey to defeat Voldemort. Second, the relationships. Bond has his love interests and comrades, and Harry has his friends and romantic interests. These relationships play important roles in both stories. Third, the presence of antagonists. The villains in both series are formidable and drive the plot forward, which gives a similar feel in terms of the overall narrative structure.
One reason could be the hero - centric nature. Just as James Bond is the central figure in his adventures, Harry Potter is the focus in his own story. They both embark on dangerous quests and have to outwit their enemies. Another reason might be the element of secrecy. Bond has his spy secrets, and in Harry Potter, there are many secrets within Hogwarts and about the wizarding world.