There is an issue in scope in which .SDcols is evaluated.
AFAIU there is no need to evaluate it in x's scope, and that is likely caused an issue here.
data.table(V1=-1L, V2=-2L, V3=-3L)[,.SD,.SDcols=-V2:-V1]
#Error in `[.data.table`(data.table(V1 = -1L, V2 = -2L, V3 = -3L), , .SD, :
# Internal error: xcolAns does not pass checks: 1121
as.data.table(as.list(1:2))[, .SD,.SDcols=(-1L)]
#Error in colnamesInt(x, cols, check_dups = FALSE) :
# argument specifying columns specify non existing column(s): cols[1]=-1
as.data.table(as.list(1:3))[, .SD,.SDcols=(-1L)]
#Error in `[.data.table`(as.data.table(as.list(1:3)), , .SD, .SDcols = (-1L)) :
# Internal error: xcolAns does not pass checks: 2211,2
There is an issue in scope in which
.SDcolsis evaluated.AFAIU there is no need to evaluate it in
x's scope, and that is likely caused an issue here.