Problem/Motivation
If you pass a completely invalid extension to LibraryDiscoveryParser::buildByExtension() it just assumes it's a theme. This results in php notices when trying to load the libraries.yml file and similar.
Proposed resolution
Provide a more useful error message, ideally throw an exception if we don't think it's breaking bc to do so.