Thanks to comments above I finally tracked the issue down to the fact that some Guids were all uppercase and some were all lowercase. It seems the Entity Framework scaffolding process for SQLite is case sensitive when it comes to Guids.
So to answer my own question:
Make all Guids in the database uppercase and this will solve the issue.