Yes, that is intended to disallow officers from avoiding taxes by being compensated via ‘loans’ and other means. I can’t find any case where dividends or buybacks were found to be violations of that rule.
https://cpataxteam.com/blog/s-corp-owners-are-you-paying-you...Do the math for yourself. Paying corporate taxes on profits, then dividend taxes on what gets paid out is not a savings versus paying income+payroll tax (which comes from money that is treated as an expense at the corporate level).