A buggy program preventing sleep is a bug in that program, not a mark on the overall support and reliability of sleep functionality in macOS.
There are valid reasons why a program might need to block sleep, so it's not like macOS is going to hard-prevent it if a program does this. Most programs should not be doing that though.