If T isn’t Vec<Vec<i32>>, then return arr; won’t work because the type of arr, Vec<Vec<Vec<i32>>>, is not the same type as Vec<T>. Rust wants your function definition to work for all possible instances of T, so it rejects your definition because of that statement.
(To be more precise, arr could be a Vec<Vec<Vec<u64>>>, or a Vec<Vec<Vec<usize>>>, for instance, since integer literals don’t have a particular type that they’re forced to be.)