not randomly, no. of course not.
but, the optimizer is a "model", it takes LOTS of inputs, lot and lots of them, and then decides what to do.
So yes, a query that worked yesterday "by complete and utter accident" might not tomorrow because the plan changed.
Consider (using 9i for this trivial example)
ops$tkyte%ORA9IR2> create table t ( x int, str varchar2(10) );
Table created.
ops$tkyte%ORA9IR2> insert into t values ( 1, '1' );
1 row created.
ops$tkyte%ORA9IR2> insert into t values ( 2, 'x' );
1 row created.
ops$tkyte%ORA9IR2>
ops$tkyte%ORA9IR2> select * from t where str = 1 and x = 1;
X STR
---------- ----------
1 1
ops$tkyte%ORA9IR2> exec dbms_stats.gather_table_stats( user, 'T' );
PL/SQL procedure successfully completed.
ops$tkyte%ORA9IR2> select * from t where str = 1 and x = 1;
ERROR:
ORA-01722: invalid number
simple change in optimizer -> simple change in way query is processed -> query fails
you should never use an implicit conversion.
if you code explicit conversions, it will be obvious what MIGHT happen:
select * from t where to_number(str) = 1 and x = 1;
^^^^^^^^^^^^^^ uh-oh, that could be a problem!
it is not that you would re-execute the query over and over - it is that something would change the plan and then BAM.