Make a slow error quine maker! As part of his answer to Make an Error Quine!, @Falko proposed the following algorithm:


  How to create your own solution in 2 minutes?
  
  
  Open a new file in an IDE of your choice.
  Bang your head onto the keyboard in front of you.
  Compile.
  Replace the code with the compiler error message.
  Repeat steps 3 and 4 until the code converges.
  
  
  I bet such a procedure terminates pretty quickly in most cases!


Task

Your task is to prove him wrong.

Write a full program that satisfies the following:


When compiled or interpreted, it produces an error message that, when compiled or interpreted in turn, also results in an error message.
Repeating step 1 over and over again will eventually encounter a fixed point, i.e., an error quine.


Additional rules


The final error message must have a positive length. However, the previous error messages and the original source code may be empty.
The original source code's length may not exceed 1024 bytes.
Neither the original code or the code generated in any of the steps may produce non-error output.

The output has to be clearly identifiable as an error message, which has to be generated by the compiler/interpreter due to a syntax error, runtime error, undefined reference, etc.
Your program may not receive any input or require any flags to produce the loop.
Your program may rely on a specific implementation of its language or version thereof.


Scoring

Your score is the finite number of steps your source code requires before producing an error quine. The submission with the highest score wins.

The length of the original source code will be used as tie breaker. Shorter is better.

Example

In Chicken, the program



generates the following error message:

TypeError: Cannot read property 'NaN' of undefined


If this error message is, in turn, interpreted, it produces the error message

Error on line 1: expected 'chicken'


which, if interpreted in turn, produces itself.

Thus, the score of the empty Chicken program is 2.

Counterexample

The PHP code

ab&lt;?=c


generates the error message

PHP Parse error:  syntax error, unexpected '?' in Command line code on line 1


which produces itself when interpreted.

However, the second source code prints the message to STDOUT, making this sequence invalid.
Bash, 9223372036854775810

Inspired by Doorknob's answer.

a='"2&gt;/dev/null;if(((i=$((i-1)))&gt;0));then $(declare -p a);$a;else 1;fi #"'
i=2**63
eval $a


It should be run with bash &lt; file.sh, or use the same file name for each program, to get rid of the different file names in the error messages.

The first few errors are (with LANG=C):

bash: line 3: 2&gt;/dev/null;if(((i=9223372036854775807)&gt;0));then declare -- a="\"2&gt;/dev/null;if(((i=\$((i-1)))&gt;0));then \$(declare -p a);\$a;else 1;fi #\"";"2&gt;/dev/null;if(((i=$((i-1)))&gt;0));then $(declare -p a);$a;else 1;fi #";else 1;fi #: No such file or directory




bash: line 1: 2&gt;/dev/null;if(((i=9223372036854775806)&gt;0));then declare -- a="\"2&gt;/dev/null;if(((i=\$((i-1)))&gt;0));then \$(declare -p a);\$a;else 1;fi #\"";"2&gt;/dev/null;if(((i=$((i-1)))&gt;0));then $(declare -p a);$a;else 1;fi #";else 1;fi #: No such file or directory




bash: line 1: 2&gt;/dev/null;if(((i=9223372036854775805)&gt;0));then declare -- a="\"2&gt;/dev/null;if(((i=\$((i-1)))&gt;0));then \$(declare -p a);\$a;else 1;fi #\"";"2&gt;/dev/null;if(((i=$((i-1)))&gt;0));then $(declare -p a);$a;else 1;fi #";else 1;fi #: No such file or directory


And finally:

bash: line 1: 2&gt;/dev/null;if(((i=0)&gt;0));then declare -- a="\"2&gt;/dev/null;if(((i=\$((i-1)))&gt;0));then \$(declare -p a);\$a;else 1;fi #\"";"2&gt;/dev/null;if(((i=$((i-1)))&gt;0));then $(declare -p a);$a;else 1;fi #";else 1;fi #: No such file or directory




bash: line 1: 1: command not found




bash: line 1: bash:: command not found


which is an error quine.