Differences in printed commands after execution with same code

I have a korn shell script that executes a function which is stored in a common library. In the function there is obviously some code. Here is the line of code in the function in question:

temp=`echo $status_cnt|tr -d [0-9]`

When the shell script executes with set -x, I'm seeing that on most occasions that the below commands and their arguments are printed as expected based on the above line of code. I'll call this the desired result.

Desired Result
+ + echo 2
+ tr -d [0-9]

However on other, less frequent occasions, I'm seeing the below commands and arguments when the code is executed. I'll call this the undesired result.

Undesired Results
+ + tr -d 2
+ echo 2

Assuming the code in the function is identical on all occasions, what would cause the deviation between the desired and undesired results?

Firstly, why would the 2 commands appear in different order (i.e. shouldn't I always expect the echo to be printed first in the desired result since the echo command precedes the tr -d [0-9] command when being assigned to temp variable)?

Secondly, what would cause the tr -d [0-9] to be printed as tr -d 2?

Thanks in advance!

Additionally, could you please post what is that you are trying to achieve? Sample input, expected operation, sample output

I'm trying to find the reason for the different behavior when the commands and arguments are printed using set -x when the same function is executed. In the Undesired Results, you can see that when $status_cnt = 2, the end result is the same (i.e. the loop continues) as in the Desired Results but when when $status_cnt = 1, the loop prematurely exits in the Undesired Results.
The purpose of the translate function tr -d [0-9] is to delete numerics before assigning to temp variable but why do I see "+ + tr -d 2" in the Undesired Results and why is the print order different when executing the same function?

Here is the function:

 
check_report_completion()
#ARG1 = jobid array
{
set -x
jobid=$1
status_cnt=9999
until [ $status_cnt -eq 0 ]
do
sleep 15 
sqlplus -s $AS_CONNECT_STRING<<EOF |read status_cnt
whenever sqlerror exit sql.sqlcode; 
SET FEEDBACK OFF;
SET PAGESIZE 0;
select count(*)
from rw_server_queue where job_id in ($jobid)
and status_code in (1,2,3,10);
EOF
temp1=`echo $status_cnt|tr -d [0-9]` 
temp2=${temp1:-"numer"}
if [ $temp2 = "numer" ] 
then
:
else
status_cnt=9999
break
fi
done
echo $status_cnt
}

Desired Results Execution:

 
+ + check_report_completion 0,14193,14194
+ jobid=0,14193,14194
+ status_cnt=9999
+ [ 9999 -eq 0 ]
+ sleep 15
+ read status_cnt
+ sqlplus -s /@compasp
+ 0<<
whenever sqlerror exit sql.sqlcode; 
SET FEEDBACK OFF;
SET PAGESIZE 0;
select count(*)
from rw_server_queue where job_id in (0,14193,14194)
and status_code in (1,2,3,10);
+ + echo 2
+ tr -d [0-9]
temp1=
+ temp2=numer
+ [ numer = numer ]
+ :
+ [ 2 -eq 0 ]
+ sleep 15
+ read status_cnt
+ sqlplus -s /@compasp
+ 0<<
whenever sqlerror exit sql.sqlcode; 
SET FEEDBACK OFF;
SET PAGESIZE 0;
select count(*)
from rw_server_queue where job_id in (0,14193,14194)
and status_code in (1,2,3,10);
+ + echo 1
+ tr -d [0-9]
temp1=
+ temp2=numer
+ [ numer = numer ]
+ :
+ [ 1 -eq 0 ]
+ sleep 15
+ read status_cnt

Undesired Results Execution:

 
+ + check_report_completion 0,28030,28031
+ jobid=0,28030,28031
+ status_cnt=9999
+ [ 9999 -eq 0 ]
+ sleep 15
+ read status_cnt
+ sqlplus -s /@compasp
+ 0<<
whenever sqlerror exit sql.sqlcode; 
SET FEEDBACK OFF;
SET PAGESIZE 0;
select count(*)
from rw_server_queue where job_id in (0,28030,28031)
and status_code in (1,2,3,10);
+ + tr -d 2
+ echo 2
temp1=
+ temp2=numer
+ [ numer = numer ]
+ :
+ [ 2 -eq 0 ]
+ sleep 15
+ read status_cnt
+ sqlplus -s /@compasp
+ 0<<
whenever sqlerror exit sql.sqlcode; 
SET FEEDBACK OFF;
SET PAGESIZE 0;
select count(*)
from rw_server_queue where job_id in (0,28030,28031)
and status_code in (1,2,3,10);
+ + echo 1
+ tr -d 2
temp1=1
+ temp2=1
+ [ 1 = numer ]
+ status_cnt=9999
+ break
+ echo 9999