Problem/Motivation
When you delete a view display (and save the view), the dependencies added by that display are not removed from the dependencies list at the configuration entity for that view. It causes a remaining dependency relationship that shouldn't exist anymore. So, if you try to remove the related configuration, the entire view will be removed together.
The problem is softened by the fact that if you make any other changes to the view, the dependencies list is correctly updated. But if you just delete the display and save the view, the problem will be there.
Steps to reproduce
In a fresh standard install, I did:
1. Create a custom field (field_example) on the Article content type.
2. Create a view (id: example) for articles with a page display listing titles.
3. Create a block display and add (only for that display) the field_example on fields section; save view after that.
4. Run drush cex, so I can see the field_example listed as dependency on views.view.example.yml.
dependencies:
config:
- field.storage.node.field_example
module:
- node
- user
5. Open view for editing again; delete the block display and save.
6. Run drush cex again. The view's configuration file is updated.
If you inspect the views.view.example.yml in that moment, the block display is gone, but the field_example continues listed on dependencies.config section. There is no other reference to the field except that.
Furthermore, if you try to delete field_example, the view is listed to be deleted together.
I also tested with a custom user role. I put it as an access requirement on a display and deleted the display after that. The same happened: the role continued listed as view's dependency.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet