Turborepo team member here.
It looks like the db:generate doesn't have an env key with DATABASE_URL in it. Because of this, Turborepo's Strict Mode doesn't know to allow that environment variable into that tasks' environment. It looks like this is done correctly for the build task, so you could follow that same pattern.