It's probably a firmware issue, not telling OctoPrint the print is finished. When the printer is printing from SD OctoPrint is locked out of the room and does not know what is going on besides what it is told.
This looks like Creality Stock Firmware, which the usual bug-ridden one. This would be my first point to change, is use a different firmware - we've had loads of random bugs from it, this is probably another one. Or you can also print from OctoPrint rather than the SD card to ensure that it knows fully what is going on.
Please find the systeminfo bundle from my latest fail (normal mode + print from SD, serial log enabled)
I had a quick look and found some older traces in traces. To be clear the faulty print start on 2021-05-27 23:48:57, it was finished around 05-28 01:28:30 and I see the tracking plugin still reporting printer_state = 'PRINTING' at 05-28 01:36:13
2021-05-27 23:48:57,913 - octoprint.util.comm - INFO - Changing monitoring state from "Operational" to "Starting print from SD"
Thanks for the info, I did a test printing from octoprint filesystem and it works ... so it seems it is somewhat linked to printing from SD.
And yes 1.0.2 is stock firmware, in fact I don't like to flash firmware (I bricked a video card 20 years ago doing that) but I may have to in this case ... I will check how I can do it on a 3d printer.
When printing from SD, OctoPrint has to rely on the firmware for progress reports. It will not be able to know the print has completed unless the firmware reports 100% progress and says "print finished". Neither happens here:
Your firmware reports 2 bytes as still missing on the second to last M27 (= get SD print status), and never ever even responds to the last one. That's broken behaviour on part of the firmware. Either flash mainline Marlin (a good anyhow since Creality broken is known to be all kinds of broken) or don't print from SD.