It’s no so much stacking that’s a notable symptom, it’s collecting, arranging, sorting and displaying, often without playing with the toys as intended. Instead the focus is more on neatly sorting by color / shape / size etc. and sometimes preferring to keep them in that configuration over playing with them.
This is similar to the tendency for some autistics to focus on the part of a toy, like spinning the wheels on a toy truck, instead of playing with the truck doing truck things.
While these are commonly associated with autism, these two examples are neither necessary or sufficient symptoms to diagnose autism. Meaning that you can see this symptom in an allistic (not autistic) person and it does not mean they have autism and you can have autism and not have these symptoms.
One thing common to many autistic people is ground up processing. Their minds do incredibly well with details (the spinning truck wheel, the defining characteristics of the toys they sort) but sometimes don’t see “the big picture” as easily. It can be an incredible strength in many ways, especially when embraced and harnessed instead of shamed and “corrected.”