Default TCollection.Add method returns a TCollectionItem, even though it's actually an instance of whatever items the collections manages (this isn't specific to DWScript, it's a Delphi VCL thing).
To simplify that, most subclassed collections in DWScript now reintroduce an Add method that will wrap the default one with a cast, so you don't have to do the cast manually. So chances are you're on older version of DWScript.
If you don't want to update, you can just use
(MyDwsUnit.Arrays.Add as TdwsArray)
instead.