Dune director Denis Villeneuve thought Baron Harkonnen easily could have become silly if he wasn’t careful.
I'm not convinced that they were right to think they had to avoid making him campy. Lots of dictators are "campy." North Korea's Kim family are campy. Campy dictators are horrifying in real life, and it could have worked in the movies if they sold it right.
I think one of the issues with filming Dune is that its humorlessness is a bigger liability on the screen then on the page, to me at least. It would probably be easier to make the villains funny than the heroes.