SQLite Forum

INSERT with RETURNING causes duplicate rows
Login
I have found this also. 

I think problem is when a prepare function is executed.
I have SQLite manager like program that must detect if statement will
return data or not. So I call prepare to get column count. In this case
with returning I get the same result (rows inserted twice).

Maybe PHP driver is doing the same.

I did not report this I think no one will care because as you sad in CLI
shell (I tested also) this works without a problem. So this is not a bug
just should not be used with prepare.