How to Summon a Nitwit with trades:
Use Commands or go to this page:
https://www.digminecraft.com/generators/villager_trade.php
(Make sure you select the Profession "Nitwit")
Once you summoned a Nitwit with Trades, you will enter the Trades and the Summoned Nitwit will still shake it's head despite having Trades
The game probably checks which profession a villager has to determine whether it should shake its head or not, and doesn't actually check whether the villager has any trades.