The error is a bit cryptic:
Error in array(STATS, dims[perm]) : 'dims' cannot be of length 0
In addition: Warning messages:
1: In sweep(track[, -1], 2, track[1, -1]) :
STATS is longer than the extent of 'dim(x)[MARGIN]'
Caused by tracks with length 1 (problematic automated tracking), can be solved by filtering the tracks before the lapply, but can also be handled by letting .normalizeTrack return a length 1 track with only the origin.