I don’t know if that is intentional or not, but on my current play there are pillagers that spawned for an attack, then moved specifically to the ruins far away from my settlement that I am trying to dig up and just stay there as if the AI director is trying to deny me that artifact burried there.
I marked the specific spot on the minimap (red is the enemy troops, green is my city)
And for the record, I upgraded my military defenses and killed a group of them at that place before. But the AI later just respawned and went again back there to guard it. My next attempt will be to destroy the pillager camp next to my city, so it also slows down their attack rate.
Interestingly, since I upgraded my Walls, they never attacked in a big group my city again. Before that I had a big wave once with 30-40 of them + a ram for the buildings, they almost destroyed my city hall in that attack. But since then? Peanuts.