Including the rest of the config block that the errors occurs in for debugging trace for invalid extends
### Problem to solve
<!-- What problem do we solve? -->
The debugging trace for invalid `extends` is not semantically useful enough. Currently, it requires the user to go back and dig through the raw YAML file for a line number (if gitlab-ce#51846 is implemented) in order to find out what is wrong exactly.

### Intended users
<!-- Who will use this feature? If known, include any of the following: types of users (e.g. Developer), personas, or specific company roles (e.g. Release Manager). It's okay to write "Unknown" and fill this field in later.
Personas can be found at https://about.gitlab.com/handbook/marketing/product-marketing/roles-personas/ -->
### Further details
<!-- Include use cases, benefits, and/or goals (contributes to our vision?) -->
This has been scoped of from https://gitlab.com/gitlab-org/gitlab-ce/issues/51846 and can be considered a follow up.
### Proposal
<!-- How are we going to solve the problem? Try to include the user journey! https://about.gitlab.com/handbook/journeys/#user-journey -->
The debugging trace for invalid `extends` could be made more informative by including the rest of the config block that the errors occurs in. If combined together with https://gitlab.com/gitlab-org/gitlab-ce/issues/62930 and the format/layout of the config block makes sense, this will make a solid improvement over gitlab-ce#51846

### Permissions and Security
<!-- What permissions are required to perform the described actions? Are they consistent with the existing permissions as documented for users, groups, and projects as appropriate? Is the proposed behavior consistent between the UI, API, and other access methods (e.g. email replies)? -->
### Documentation
<!-- See the Feature Change Documentation Workflow https://docs.gitlab.com/ee/development/documentation/feature-change-workflow.html
Add all known Documentation Requirements here, per https://docs.gitlab.com/ee/development/documentation/feature-change-workflow.html#documentation-requirements -->
### Testing
<!-- What risks does this change pose? How might it affect the quality of the product? What additional test coverage or changes to tests will be needed? Will it require cross-browser testing? See the test engineering process for further guidelines: https://about.gitlab.com/handbook/engineering/quality/guidelines/test-engineering/ -->
### What does success look like, and how can we measure that?
<!-- Define both the success metrics and acceptance criteria. Note that success metrics indicate the desired business outcomes, while acceptance criteria indicate when the solution is working correctly. If there is no way to measure success, link to an issue that will implement a way to measure this. -->
### Links / references
issue