You're using the wrong thing. ForEach<Data, ID, Content> is a SwiftUI struct and expects to be provided a view in its content closure.
What you're looking for is Collection.forEach(_ body: (Self.Element) throws -> Void), which iterates over a collection.