You seem to have a few things going on here, but one is you seem to be stuck on using MySQL's LAST_INSERT_ID in the query sent to PDO

PDO is designed to work with many database types, not all have LAST_INSERT_ID
I don't know how and where PDO decides which database is being used and which syntax to use, but my guess is it doesn't work with LAST_INSERT_ID in the query.

But PDO does have lastInsertId() which I'm guessing will convert it to LAST_INSERT_ID for you (or an equivalent if not a MySQL database).

I think if you change your use of LAST_INSERT_ID to lastInsertId at least this problem will be resolved