Fix the showing of error message when we truncate the variable name in the display

Reviewer: Tiff Go

Issue: CP-8798