I got this error. It appears in my case that an array I was using to populate views with a ForEach loop increased in size over time and began to include duplicates. When I removed the duplicates from the array, these errors stopped.
Post
Replies
Boosts
Views
Activity
If you simplify the let gradient line to
let gradient = Gradient(colors: [.red, .green, .blue])
It works