a is a real number.If equations below have 2 roots in common what is the value of a?

x^2-2x-5=0

x^3-3x^2+a+1=0

I found the answer but the question has two answers and I don't understand why :

1)x1+x2=2

x1+x2+x3=3 and x3=1.

1-3+a+1=0 and a=1

2) x1.x2.x3=-a-1

x1.x2=-5

and a=4

Why did I find 2 answers?