issue #22341: Make planner code more friendly to extensions. Remove duplicate error that should have been in extension anyway.