My MacOS swift app refuses to close (When running on Monterrey, The app becomes unresponsive after it finishes all its work, and needs to be forcefully closed)

My MacOS swift app [myStuckApp5] refuses to close when running on Monterrey (The app becomes unresponsive after finishing its work, and needs to be forcefully closed). However, it closes as expected when running MacOS 13 and above. How can I troubleshoot this error?

I'm attaching the content of the sys Log related to the app while it was stuck (too long to copy here...)

My MacOS swift app refuses to close (When running on Monterrey, The app becomes unresponsive after it finishes all its work, and needs to be forcefully closed)
 
 
Q