Ah, I misunderstood your schema - jsonb_array_length is what you’d want if you have a column of type jsonb containing a value that’s an array at top-level; this type indicates that your column is a jsonb[] - a Postgresql array of jsonb values. In that case you’d want array_length instead. Note that the second argument counts from 1, based on the example with a 1-dimensional array.
You may want to consider caching the count in a column on projects; I don’t know if array_length is indexable.