Not sure if it is a bug or ignorable edge case.
When app name begins or ends with a character which has no uppercase then several characters can be inserted into avatar. For example when name ends with German ß:
Theoretically there may be up to 6 characters instead of normal 2:
If you want always up to 2 letters you have change casing first and then extract letters, it seems that now it is done in opposite way.