The hand-written type doesn't match the shape supabase-js expects (it wants public: { Tables: { x: { Row, Insert, Update, Relationships } }, Views, Functions, Enums, ... }). When one piece is missing, the generics fall through to never.
Don't hand-write it, generate it:
npx supabase gen types typescript --project-id <your-ref> > types/database.ts(--local instead of --project-id if you run Supabase locally.) Keep createClient<Database>() as is.
Add it as a script so you re-run it after each migration:
"db:types": "supabase gen types typescript --project-id <ref> > types/database.ts"