Docker stop behaving differently on different operating systems

I am running a java application image using docker run <image_id> with two different setups below.
when I do docker stop <container_id> the graceful shutdown doesn’t work properly in Debian while it works fine in MacOs.

Can someone please help, not really sure what can cause this different behaviours.

Setup-1
OS: MAC OS BIGSUR
Docker: 18.09.2
Setup-2
OS: Debian GNU/Linux 9.12 (stretch)
Docker: 18.09.4