Avoided unnecessary substring creation for field error access with wildcard

Issue: SPR-11374
(cherry picked from commit 5be8301)