Let me see if I can reproduce this. If you created a new component - ie -- MyCarousel, and then added the HTML from the Core Carousel - it should work.
I am not sure what you mean by closing a page. TO me that sound like you want to close the browser that is displaying the page.Can you please provide more detail.
As you are a new AEM Developer (I assume you are a developer) - you should go here and complete this:Getting Started with AEM Sites - WKND TutorialThis will get you up and running in AEM.
So let me see if I got this. You are trying to extend the Core Carousel component. You created a proxy component under APPS. You then copied the HTML from the Carousel component and placed it under your App proxy component and it stopped working?
See this article - where we used @Reference in a SLing Servlet: Adobe Experience Manager Help | Querying Adobe Experience Manager 6.4 JCR data using the QueryBuilder API