I disabled the Ubuntu Dock extension using the Gnome Extensions app and tried to reproduce the bug, and the bug didn't happen anymore.
When I installed the Dash to Dock extension by the Gnome Extensions site, and tried to reproduce the error, nothing wrong happened.
I think that the bug is caused by the dock, and the version 68 of Dash to Dock fixed this bug. The Ubuntu dock is still in version 67.
I disabled the Ubuntu Dock extension using the Gnome Extensions app and tried to reproduce the bug, and the bug didn't happen anymore.
When I installed the Dash to Dock extension by the Gnome Extensions site, and tried to reproduce the error, nothing wrong happened.
I think that the bug is caused by the dock, and the version 68 of Dash to Dock fixed this bug. The Ubuntu dock is still in version 67.