is it possible that this result was derived for a sphere?
This is quite general for isolated potential systems. Total energy of a particle: E=KE+PE. E=0 at infinity. KE=1/2mv^2, PE=mP where P is the gravitational potential (volume integral of -G*rho/r dV). Escape velocity corresponds to E=0, so we get v=sqrt(-2P), regardless of anything else.
This is quite general for isolated potential systems. Total energy of a particle: E=KE+PE. E=0 at infinity. KE=1/2mv^2, PE=mP where P is the gravitational potential (volume integral of -G*rho/r dV). Escape velocity corresponds to E=0, so we get v=sqrt(-2P), regardless of anything else.