How to close context with auto-closed tab

Hi all,

I’m having problem with closing the context where browser tab was auto-closed.

The scenario that I need to perform is:

  1. New context
  2. Open browser
  3. Open new tab (automatically open after click on button)
  4. Close tab (automatically closed after saved changes)
  5. Close context

I can not properly close the context because I’m having following error: Error: page.bringToFront: Target page, context or browser has been closed.
It looks like it stores somewhere in memory already auto-closed tab.
I’m using Chromium 102.0.5005.40

Here is my code sample: