Reading the help of factor shows that factor will only factor rationals, unless you tell it what extensions to use. sqrt(3) is not rational. You could generate such a list from roots, see below.
expr='(x**3-3*x)'
# find extensions needed for factor.
# of course, we could also simply use the roots directly and form a poly
# extension=True here lets it detect sqrt, etc
r=set([abs(x) for x in list(roots(expr,extension=True).keys()) if not x==0])
f=factor(expr,extension=r,deep=True)
print(f)
I suspect it is also possible to directly take the output of roots, and generate a factored polynomial. I didnt see that in the docs, so this does it:
f=1
x=symbols('x')
for k,v in roots(expr,extension=True).items():
f=f*(x-k)**v