So an analysis of the original recipe gives the following (I've omitted baking soda & salt for brevity):
2 cups AP flour 100.00% 250.0 g
½ cup sugar 24.00% 60.0 g
80 grams butter 32.00% 80.0 g
1 egg 20.00% 50.0 g
3 Tbsp milk 18.40% 46.0 g
water(b:13g,e:38g,m:40.3g) 36.52% 91.3 g
As you can see from the baker's percentages, the sugar and butter are quite low for a cookie (cookies usually tend to have at least twice as much sugar and butter as specified here). A cookie with a relatively high sugar content (say, 80%+ of the weight of the flour) has a crystalline structure and the sugar plays an important part of holding things together (see this answer for more info). In this recipe, though, with the lower sugar and butter levels and added moisture in the form of milk, it's likely that the gluten network and starches play a somewhat larger role in also providing structure.
Translating this recipe to almond flour and powdered erythritol gives the following analysis.
2 cups almond flour 100.00% 224.0 g
½ cup powdered erythritol 37.05% 83.0 g
80 grams butter 35.71% 80.0 g
1 egg 22.32% 50.0 g
3 Tbsp milk 20.54% 46.0 g
water(b:13g,e:38g,m:40.3g) 40.76% 91.3 g
Right off the bat, I can see there's several problems you're going to run into.
Almond flour has very little built-in structure-building properties when compared to wheat flour, so it will need to rely on other ingredients. While erythritol can provide structure, it'd likely need to closer to 80% (180 g) to do so. While you could do that, that would likely alter the taste quite a bit. The second issue is the milk. While I'm sure it plays an important role in making the original cookie what it is, it will only hurt things here by watering down the egg proteins. Mixing the milk with almond flour will have no effect like it would with regular flour. At 40%, the liquid level is pretty high, and since the binding power of the egg has basically been cut in half, it's understandable why you had a crumbly mess.
The sugar in the original recipe is hygroscopic (water-loving) and will help retain some of that extra moisture from the milk. Both erythritol and almond flour are "moisture-neutral": they don't really hold onto moisture during baking. So that extra moisture has nowhere to go and evaporates. While doing so, it tends to push the butter fats out with it, leaving a greasy puddle under the baked cookies (though it may not be as bad here because the amount of butter is pretty low).
Your best bets to create an adaption that retains most of the characteristics of the original are as follows: First, since erythritol is roughly 75% the sweetness of sugar, you could consider increasing it to 110 g, which might help provide better structure. Alternatively, you could use xanthan gum as you found. Inulin may also help provide structure and sweetness, though can cause digestive issues if you're not used to it. Vital wheat gluten would be interesting to test. You might also try unflavored gelatin to provide structure once the cookies have cooled.
EDIT
So I did a small scale test using 0.5% xanthan gum and some of my other suggestions and it worked fairly well. Scaled up, the recipe would look like this:
2 cups almond flour 100.00% 224.0 g
3/8 tsp xanthan gum 0.50% 1.1 g
~⅔ cup powdered erythritol 50.00% 112.0 g
¾ tsp baking soda 1.54% 3.5 g
1 g salt 0.45% 1.0 g
80 grams butter 35.71% 80.0 g
1 ½ large eggs 33.93% 75.0 g
water(b:13g, e:57g) 31.25% 70.0 g
You'll notice I left out the milk: after adding the egg to the mixture, I found it had the right consistency as it was then. Adding milk at that point would probably have been too much moisture. I upped the powdered erythritol to 50% which helped provide some structure when cooled. You could probably try to see how low you could push the egg while starting to incorporate some milk, while trying to keep the moisture level about the same.
EDIT 2:
Regarding the role of an egg: they really are a versatile kind of magical ingredient if you will. In a general sense, they are a structure-builder, a source of moisture, an emulsifier, a drying agent (the egg white proteins), and act as an edible glue. It can act as a leavening agent when it's used in higher quantities (not like in this cookie recipe).
Cookies tend to have very low moisture content (from say, 15% - 40% moisture by weight compared to the weight of the flour). In most cookie recipes, eggs serve as a primary source of moisture. They are also a structure builder in that once the egg proteins reach a high enough temperature, they "set" and keep their shape. In this Almond Flour adaption cookie recipe in particular, it acts as a kind of sticky glue that holds everything together before baking (and somewhat after baking as well). Egg and milk are quite different in that regard: when it comes to almond flour, milk has little gluing power compared to an egg. As a result you'd need to use gums or other polysaccharides or proteins to do the job of the egg.
While I love baking with flaxseed meal, a flax egg here would be out of place. An egg is very neutral in terms of flavor and texture, and a flax egg is anything but. Psyllium husk powder is somewhat similar to the soluble fiber in flaxseed meal and is a more neutral taste, though too much of it can cause the texture to suffer. I would probably try upping the xanthan gum to maybe 1.5% (3.4 g) and add milk slowly to see if you can get things to come together. It'd also be interesting to see if vital wheat gluten could work. So after doing another test, I'd try the following to start with:
~1 ¾ cups almond flour 90.18% 202.0 g
~2 ½ Tbsp vital wheat gluten 9.82% 22.0 g
1 1/8 tsp xanthan gum 1.50% 3.4 g
~⅔ cup powdered erythritol 50.00% 112.0 g
¾ tsp baking soda 1.54% 3.5 g
1 g salt 0.45% 1.0 g
80 grams butter 35.71% 80.0 g
52 g milk 23.21% 52.0 g
water(b:13g, e:47g) 26.68% 60.0 g
(By the way, I'm also interested in these results, as I've experienced similar issues trying to adapt a Boterkoek (Dutch butter cake) recipe to use almond flour).