Function with case return too many columns error - Supabase