Hello Ebo!,
Let's use the steps below to make sure that your Mac mini is all up to date:
Before installing new software, it's a good idea to back up your Mac.
1. From the Apple menu in the corner of your screen:
• Choose System Settings. Then click General in the sidebar, and Software Update on the right.
• Or choose System Preferences. Then click Software Update.
2. If Software Update finds new software, click the Update Now or Upgrade Now button to install it.

3. Enter your administrator password, if asked. During installation, your Mac might restart, and you might see a progress bar or blank screen several times.
You can also find those steps in this resource: Update macOS on Mac - Apple Support
Updating can sometimes help address odd behaviors.
Should that still persist, is your display connected directly to your Mac mini, or are you using an adapter or hub?
Have you experienced this behavior with other displays?
When this behavior occurs, does disconnecting and reconnecting your display to your Mac mini appear to have any impact?
Let us know, and we'll keep moving forward based on those details.