Why does this SQL prepared statement reuse the wrong plan?

Why does this SQL prepared statement reuse the wrong plan. The SQL code uses a prepared statement with different param values. In MySQL the first execution picks a plan. In SQL later values may need a different plan but get the wrong one.

#whatswrongwiththissqlquery #sqlbug #sqlproductionbug #sqldebugging #sqldatabase #sqlcodereview #sqlperformance #sqlreliability #sqlanalytics #sqldatain...

https://www.youtube.com/watch?v=PJT_qVSjNBc

Why does this SQL prepared statement reuse the wrong plan? #sqlreliability

YouTube