can happen in regular villages if you want to get a specific villager like a Fletcher. They will cycle through about 7-20 times before returning back to normal.
Environment
The villager will randomly swap from nitwit and their profession and this causes trades to change if profession is not locked from a trade or a whole day cycle.
Duplicate of MC-151079