Your code is working as expected. I was able to execute the same when a different equation was used. Check if the equation you are using contain dimensional mismatches.
The following code works:
x=sym('x', [1 4]);
y=[1 2 3 4];
z=[2 3 4 5];
sol=solve(x.*y+z+1==0,x); % You can change this equation
sol.x1
sol.x2
sol.x3
sol.x4
% Converting it into an array of type double
temp=struct2cell(sol);
sol_arr=double([temp{:}]);
"sol_arr" returns the array of answers that you require.