I've had the same problem.
It seems the discrete PID option does not handle a sampling time of "-1" (should have inherited the sampling time it that case)
So the workaround for your problem is to enter your own explicit expression for the sampling time. do not leave it on "-1".
This should eliminate the "The second input argument of the "d2d" command must be a positive scalar."