"When Laptop Lid Closed" options overrule a shutdown

I am currently running the KDE spin of Fedora 40, which uses KDE 6. I’m tremendously happy with KDE 6 so far, barring a few minor issues. However, there is one particular problem that has plagued me on a couple laptops I’ve used that had KDE 5.26, 5.27, and the most up-to-date version, also running Fedora, all of which used Wayland. I have not tested this on X11. I suspect it would appear on older versions of KDE, if I had used them.

Whenever I power off my laptop (by pressing “Shut Down” on the logout screen) but close the lid before the device has completely shut down, the device will fail to power off.
I believe this is in some way caused by my Energy Saving settings, as this only happens when the “When laptop lid closed” option is set to “Sleep” or “Lock Screen”. When set to “do nothing”, the device will shut down flawlessly.

Behavior changes somewhat depending on the “on laptop lid closed” setting chosen:

When the “Sleep” setting is active under “When laptop lid closed” and I initiate a shutdown, then close the lid before the shutdown completes, the device will not fully shut down. When I open the lid again, the screen will be black but still backlit, and the mouse will sometimes be visible and movable. My keyboard’s RGB will still be active (when in sleep mode, RGB and backlight will be off), indicating that the device is neither sleeping nor powered off. In one instance, my laptop’s fan started to turn on at full speed after staying in this state for a prolonged period of time.

When the “Lock Screen” setting is active under “When laptop lid closed”, and I perform the same process in the above paragraph, upon opening the laptop lid again, the device opens to the lock screen, which I can interact with, but it will continue shutting down once this screen is visible.

When the “Do nothing” setting is active under “When laptop lid closed” and I initiate a shutdown, regardless of whether or not I close the lid, the shutdown will complete successfully. I have not had the opportunity to test the “Shutdown” and “Turn off screen” options as of yet.

Due to the last three paragraphs, I believe that the laptop lid options in some way take priority over my device shutting down.

I tend to shut my lid as soon as I click the “Shut Down” option under the KDE Logout Screen. Is there a way to ensure that, even when “Sleep” is selected under “When laptop lid closed”, the device will shut off when “Shut Down” is run and the screen is closed before the shutoff finishes? Is there a way to set a delay for the “when laptop lid closed” action? Is this even intended behavior?
I’m a relatively new Linux and KDE convert, so any advice or suggestions would be greatly appreciated. Thank you in advance!

Edit:
System information of my current device with this issue, in case it’s relevant:
Operating System: Fedora Linux 40
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0
Kernel Version: 6.8.10-300.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 9 7940HS w/ Radeon 780M Graphics
Memory: 58.7 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: Framework
Product Name: Laptop 16 (AMD Ryzen 7040 Series)
System Version: AJ