When I need a battery (Milwaukee), if I NEED an OEM battery, I usually get them from an authorized dealer. If I can get by on a non-OEM, I usually buy an OBVIOUS aftermarket - ie. ones that are blatantly NOT labelled Milwaukee.
There are too many COUNTERFEIT Milwaukees these days, and the counterfeiters are getting better at mimicking the real stuff as posts and videos go up in the wild on "how to identify a fake battery." At least with the aftermarket labelled stuff, the seller/manufacturer isn't trying to BS you into thinking it's the real thing, and many of them are decent enough for modest use.
I don't have any aftermarket M18s, but I do have a couple of aftermarket M12s (4ah), I have never "stress tested" the aftermarket ones, but they have performed well enough FOR MY NEEDS when I have used them. The only quirk to them is that for whatever circuitry reason, if I use them in my M12 inflator, when I first turn it on, it gives an error for battery temp, but I just clear it and it works fine (note that I only use the inflator for my wife's Prius or my Tacoma, so it's not heavy use).
From WHAT I CAN TELL, the vast majority of counterfeiting issues these days are in the higher AH batteries, not so much the lower (1.5, 2.0, etc) batteries (but maybe in the high output ones). I assume it's because of the lower OEM prices make the margins less desirable.