This is a good question. I see nothing in 680 that prohibits this. If you read art. 680 the trend to keep wiring more than 5' from the pool edge, however with bonding and other situations if there is a barrier such as a fence or a pool shed then the distance rule is not used.
Even recep. that are required to be 6' from the pools edge can be closer if there is a permanent barrier such as windows and doors, etc.
I would also give 680.10 Underground wiring location a "look see"