This isn’t a malfunction - but is an intended feature of iPadOS. You have now encountered the “Shelf” - this being a feature of the revised iPadOS multitasking environment.
iPadOS permits you to have multiple “instances” (or windowed views) of the same App - each being self contained. The shelf, when triggered, shows a thumbnail of each running instance of an App.
For example, if you have three running instances of Safari, each with its own set of open tabs, you will see three thumbnails corresponding to each running instance of Safari - plus a button to open a new instance of Safari. Mail is very similar; each window might show a different mailbox or email draft. Simply tapping a thumbnail will switch directly to that running instance/view of that App.
Each App - such as Mail, Safari, Notes, Calendar, etc. - has its own corresponding shelf.
Individual open instances/windows of an App can be closed directly from the Shelf; just swipe the unwanted thumbnail off the top of the screen. Note however, that Multitasking and associated Shelf functions cannot be disabled.
This article from Appleinsider has a useful explanation of this new feature along with many of the updates to multitasking:
https://appleinsider.com/articles/21/08/12/how-to-master-multitasking-on-ipad-and-ipad-pro-in-ipados-15
The iPad User Guide is also a rich source of frequently overlooked information. The Guide is available both online using a web browser (such as Safari), or as an Apple Books download:
iPad User Guide - Apple Support
https://books.apple.com/book/id1567104892