When putting villain on a particular range, how do we take into account the unpredictable plays that some of the weaker players will make?

For example when someone pots TPNK on the river when there is a 4 straight on board? Or players check raising 66 on a 832 board with intentions of getting all in?

Does it come down to just actually SEEING them do this and then adjusting their ranges accordingly?