Make sure you have asked Safari to restore tabs and windows automatically: Global menu > Safari > Preferences > General > Safari opens with = All windows from last session.
Now the test:
1. Open a single Safari window with two tabs, e.g. Google and Wikipedia.
2. Quit Safari (Command-Q) and then start it again from the Dock. The window will be opened in the same state it was closed, that is, with those two tabs. Fine.
3. Close the window by pressing the red button in the top left corner.
Note that you haven't quit Safari, you simply closed its window, and there are no other its windows exist currently.
4. Click the Safari icon in the dock. There will be opened Safari window with no tabs. Ok, this is how we expect it work, fine.
5. Press Shift-Command-T to reopen the last closed window. And now you have two windows: one with no tabs and another with Google and Wikipedia tabs. Fine.
6. Now close the window with no tabs by pressing Command-W (or by pressing the red button) and then, when only the window with Google and Wikipedia will remain, press Command-Q to quit Safari. Then start Safari from the Dock. Bam! I expected it will open a window with Google and Wikipedia, but it has opened a window with no tabs instead! Is it a bug?
Monterey 12.5, Safari 16.1
Now the test:
1. Open a single Safari window with two tabs, e.g. Google and Wikipedia.
2. Quit Safari (Command-Q) and then start it again from the Dock. The window will be opened in the same state it was closed, that is, with those two tabs. Fine.
3. Close the window by pressing the red button in the top left corner.
Note that you haven't quit Safari, you simply closed its window, and there are no other its windows exist currently.
4. Click the Safari icon in the dock. There will be opened Safari window with no tabs. Ok, this is how we expect it work, fine.
5. Press Shift-Command-T to reopen the last closed window. And now you have two windows: one with no tabs and another with Google and Wikipedia tabs. Fine.
6. Now close the window with no tabs by pressing Command-W (or by pressing the red button) and then, when only the window with Google and Wikipedia will remain, press Command-Q to quit Safari. Then start Safari from the Dock. Bam! I expected it will open a window with Google and Wikipedia, but it has opened a window with no tabs instead! Is it a bug?
Monterey 12.5, Safari 16.1