I may found out why range units could afk and not attack

Not only wall, many objects on the map would have the same effect I shown here.
Tree, hill or even a rock. All those things could make your units not attacking and afk.

You will have to manually move them in range, or move them somewhere without any barrier.
It is a big game losing bug when your range units are afk and not attack.

Thank you @NyanRacinCat! Really appreciate the video and the extra detail here.