Well, it works for me. I solved it and put the solution here
https://www.12000.org/my_notes/solving_ODE/current_version/insu3827.htm
I used Maple to solve the generated riccati ODE for now.
Maple verified the solution.
=====================
ode:=diff(y(x),x$2)-diff(y(x),x)*y(x)-2*x=0;
mysol:=y(x) = (_C3*(sqrt(2)*I - 6)*WhittakerM(-sqrt(2)*I/8 + 1, 1/4, I/2*sqrt(2)*x^2)
+ 8*WhittakerW(-sqrt(2)*I/8 + 1, 1/4, I/2*sqrt(2)*x^2)*_C4
- 2*(_C4*WhittakerW(-I/8*sqrt(2), 1/4, I/2*sqrt(2)*x^2)
+ _C3*WhittakerM(-I/8*sqrt(2), 1/4, I/2*sqrt(2)*x^2))*
(-1 + (x^2*I + I/2)*sqrt(2)))/(2*x*(_C4*WhittakerW(-I/8*sqrt(2), 1/4, I/2*sqrt(2)*x^2)
+ _C3*WhittakerM(-I/8*sqrt(2), 1/4, I/2*sqrt(2)*x^2)));
odetest(mysol,ode)
0
===========================
Zero means correct solution.
Since you did not show what you, and just said it is wrong, it is
hard for someone to say what the issue is with what you did.
I am sure Maple solved the Riccati equation correctly there.
Mathematica also solves it, but use different special functions. Instead
of WhittakerM, it uses ParabolicCylinderD functions.
--Nasser