I think I got the proof that no such real polynomial with degree $ \geq 6$ exists.
Let $n \geq 6$
Suppose for contradiction that $z_1,\ldots,z_n \in \mathbb R-\{0\}^n$ are such that $(X-z_1)...(X-z_n)=X^n+\sum_{k=1}^{n-1}z_iX^{n-i}$
Then three useful identities appear $$\sum_{k=1}^{n}z_k=-z_1 \; \; \; \;(1)$$
$$\sum_{\large1\leq i<j \leq n}z_iz_j=z_2 \; \; \; \;(2)$$
$$\prod_{k=1}^n z_k=(-1)^n z_n \; \; \; \;(3)$$
Since $$(\sum_{k=1}^{n}z_k)^2=\sum_{k=1}^{n}z_k^2+2\sum_{\large1\leq i<j \leq n}z_iz_j$$it follows that$$z_1^2=2z_2+\sum_{k=1}^{n}z_k^2$$
Hence $$0< \sum_{k=2}^{n}z_k^2=-2z_2 \; \; \; \;(4)$$ and $$0<\sum_{k=3}^{n}z_k^2=1-(z_2+1)^2 \; \; \; \;(5) $$
$(4)$ and $(5)$ imply $$\; \; \; \;-2<z_2<0 \; \; \; \;(6)$$
thus $(6)$ and $(4)$ imply $$0<\sum_{k=2}^{n}z_k^2 < 4 \; \; \; \; (7)$$
Also $(6)$ and $(5)$ imply $$0<\sum_{k=3}^{n}z_k^2 \leq 1 \; \; \; \; (8)$$
By AM-GM, $$\left(|z_3|^2\ldots|z_{n-1}|^2 \right)^{1/(n-3)} \leq \frac{1}{n-3}\sum_{k=3}^{n-1}z_k^2 \leq \frac{1}{n-3}\sum_{k=3}^{n}z_k^2$$
Hence
$$|z_3|^2\ldots|z_{n-1}|^2 \leq \left(\frac{1}{n-3}\sum_{k=3}^{n}z_k^2\right)^{n-3} $$
Squaring, $$|z_3|\ldots|z_{n-1}| \leq \left(\frac{1}{n-3}\sum_{k=3}^{n}z_k^2\right)^{\large \frac{n-3}{2}} \leq_{ \large (8)} \dfrac{1}{{(n-3)}^{(n-3)/2}} \; \; \; \; (9)$$
By triangle inequality $(1)$, and Cauchy-Schwarz
$$2|z_1| \leq \sum_{k=2}^{n}|z_k| \leq \sqrt{n-1} \sqrt{\sum_{k=2}^{n}z_k^2} $$
Hence by $(7)$,
$$|z_1| \leq \sqrt{n-1} \; \; \; \; (10)$$
Rewriting $(6)$ as $$|z_2|\lt2 \; \; \; \; (11) $$
Recalling $(3)$ (with $z_n$ cancelled from both sides) and putting together $(9)$, $(10)$ and $(11)$, we have
$$1=|z_1||z_2||z_3|\cdots|z_{n-1}| < \dfrac{ 2\sqrt{n-1}}{{(n-3)}^{(n-3)/2}}$$
This inequality fails for $n\geq 6$.
Contradiction.
I can't prove anything for $n=5$ so maybe the conjecture doesn't hold.
Assume that $P$ has degree $n$ and let $x_1,x_2,\dots,x _n$ be all its roots (repetitions are allowed). Then $P(x)=c\prod_{k=1}^n (x-x_k)$,
and if $x$ is not a root of $P$ we have that
$$\frac{P'(x)}{P(x)}=\sum_{k=1}^n \frac{1}{x-x_k}.$$
After taking the derivative we obtain
$$\frac{P''(x)P(x)-(P'(x))^2}{(P(x))^2}=-\sum_{k=1}^n \frac{1}{(x-x_k)^2}.$$
Finally by letting $x=a$ (which is not a root) we get a contradiction:
$$0=\frac{P''(a)P(a)-(P'(a))^2}{(P(a))^2}=-\sum_{k=1}^n \frac{1}{(a-x_k)^2}<0$$
where the right-hand side is negative because $a, x_1,x_2,\dots,x _n$ are all real.
Best Answer
I'm not sure I understood the meaning of "real roots lying along a line/curve"; if roots are real numbers, how can they lie along a curve? Anyway, the following example might fit the intended meaning of the question:
The polynomial $p(x,y)=(x^2+2x+1)((x-1)^2+y^2)$ has roots along the line $x=-1$. The perturbed polynomial $(x^2+(2-\epsilon)x+1)((x-1)^2+y^2)$ has a sole root at $(1,0)$.