It is already working on the local however to implement this changes to AEM instance, we need to add the changes to the solution and build. After building the solution, it is no longer working in AEM instance.
I would like to know if you have encountered this issue?
It seems the primary type has changed from a file to a folder here. Please click on the folder and check the properties. You can modify the jcr:primaryType=sling:Folder to the correct primaryType by doing a comparison on local setup.
Usual types can be:
sling:OsgiConfig, dam:Asset etc.
Also share the logs here which can help identify the issue further.