[#10007] Fix parser logic when processing elements via API