if your object has just enough velocity to escape Earth’s gravity, it’ll begin orbiting the Sun, it won’t fall directly towards it.
I’m going to oversimplify this : if you want your object to hit the sun after leaving the Earth, it has to have the velocity of the Earth (30 km/s) but in the opposite direction of it’s orbit around the Sun.
you also should take into account the massive distance between us anl the Sun (150 million km). so you have to aim properly, otherwise your object is gonna enter a very elliptical orbit
here’s a “fun” (read “insane”) fact: France abolished the death penalty in 1981; the last execution by guillotine took place in 1977