Roth IRA limits based on earned income

Last year I put $5000 in my Roth IRA.

TurboTax says i have excess contribution of $1500 - because not enough 'earned income'.

My income came from: a W2 for $3500, and a K-1 for $58,000 from my S-Corp (I do not take a salary).

If I materially participate in my Scorp (everyday, all year), why is that not considered earned income?

Did I check a wrong box somewhere that makes it look like that K-1 was passive income?