Never heard anything about it being illegal to clear codes but could be a state thing.
The code will remain until cleared. The system does differentiate between current codes and historical (ones that have cleared but happened in the past). If the light is out, it has moved to history.
P0016 could be a number things but for an intermittant I would check the wiring and connectors first, could just be a loose wire
ps see here.
Seems to be a California/Hawaii thing.