getFieldValues contains a switch on path.parts.size() with hardcoded cases for depths 1 through 5, each manually chaining .getSobject() calls. This is verbose and would fail silently for relationships deeper than 5 levels.
Consider using a method that loops through the parts array, handling any depth.