I had the same question as How to add a vertical line to a plot and I have read the first answer using the Epilog function.
This answer solved my problem and my code is now working.
However, I don't understand why Epilog is needed by mathematica in the code. It is written in the documentation : "Epilog is an option for graphics functions that gives a list of graphics primitives to be rendered after the main part of the graphics is rendered.".
Indeed the code doesn't work without Epilog, it means if we directly put Line in the plot command. But why does Epilog solve this problem ? Why the fact to render the line after the rest of the graphic is rendered would make the thing work.
I don't understand this.