Like arrays, string indices start from 0. The string literal 'MCDXCII' has 7 characters, so its range of valid string indices are from 0 to 6 inclusive. as such, $nr[7] is not valid.
In your loop, $i = 8 on the first iteration. It is immediately decremented, so by the time you access the character with $nr{$i}, $i = 7. Thus you get $nr{7}, which as I noted is invalid.
By the way, I noticed that you use braces ($nr{$i}). Use brackets instead ($nr[$i]).