#sqrt(-10) * sqrt(-40) = (+-i sqrt(10)) * (+-i sqrt(40))#
#= +-i^2 sqrt(10)*sqrt(40) = +-sqrt(10*40) = +-sqrt(400) = +-20#
The problem here is that #sqrt(-10)# and #sqrt(-40)# are not uniquely defined since #sqrt(-1)# is not uniquely defined.
If #a in RR# and #a > 0# then #sqrt(a)# denotes the positive square root of #a#. It has another square root, viz #-sqrt(a)#.
if #a < 0# then #a# has two pure imaginary square roots which you could call #+-i sqrt(-a)#.
From the perspective of #RR#, the number #i# which we call the square root of #-1# is indistiguishable from #-i#. We cannot pick one of #i# or #-i# as #sqrt(-1)# by saying we want the positive one.