I know the Great Wall was useful to defend against enemies on land, but is there any record that people ever tried to beat the Great Wall by digging tunnels under it? If not, why didn't it happen?
Most of the Great Wall was never assaulted and was more symbolic than anything. Most of the rest only ever had to deal with small groups of roving/semi-nomadic brigands, not organised armies.
And to tunnel under something like the Great Wall in such a way as to not draw attention to your efforts you'd need a pretty large group of tunnelers, and start at a considerable distance from the wall.
Another factor to consider is that a lot of the wall (and all the pieces that were actually potential targets for larger invading groups) were/are situated in mountainous areas. You'd have to tunnel through solid rock, not soil. While easier to hold a tunnel, it also is very hard labour, especially without heavy machinery. You'd end up with a tunnel that'd not be capable of infiltrating a sizeable force quickly, meaning you'd have to make it even longer to end up in an area where the defenders are unlikely to see you emerging and setting up camp for days or weeks in order to get all your forces through the tunnel before starting the assault.
For the problems faced with tunneling assault tunnels that have to remain undetected for extended periods, look at North Korea's tunnels across the DMZ, Hamas's into Egypt and Israel, and the Mexican drug cartels' into the USA.
The DPRK uses heavy machinery to make tunnels large enough to drive tanks and trucks through, which means it takes years to complete each tunnel, and the South Koreans have got pretty good at finding and destroying them.
Hamas and the druggies make narrow, dank little tunnels that often you can't even walk through but have to crawl, and those too are often detected and destroyed quickly. They too have powertools, but no heavy construction equipment.
For a militarily viable tunnel you'd need the DPRK style, and without bulldozers, dump trucks, and pneumatic drills you'd need a lot more time to complete them. Not a viable solution. (Taking 10 years to build your tunnel? Easier to go raid another neighbour...)