According to these Macrumors articles this is normal/expected behaviour but having updating to 15.2, when I saw screen mirroring active and unable to ‘Stop Extending’ I was puzzled.
www.macrumors.com
It seems from 15.2 any external display, even if it’s your primary display, it’s considered an extended display. Not very intuitive for Macs without a built-in display especially as the option to ‘Stop Extending’ is shown in red text but does nothing.
I’ve disabled the Menu Bar module for Screen Mirroring as it gives the impression, compared to pre 15.2 behaviour, that AirPlay’s doing something when it’s just direct HDMI output.

macOS 15.2: Selectively Screen Share to Your Apple TV
In macOS Sequoia 15.2, Apple has added some new AirPlay features that allow you to selectively choose which elements of your screen you wish to...

It seems from 15.2 any external display, even if it’s your primary display, it’s considered an extended display. Not very intuitive for Macs without a built-in display especially as the option to ‘Stop Extending’ is shown in red text but does nothing.
I’ve disabled the Menu Bar module for Screen Mirroring as it gives the impression, compared to pre 15.2 behaviour, that AirPlay’s doing something when it’s just direct HDMI output.