I have used this function and found that it doesn't activate the application synchronously because sometimes this function completes before any of the activated application windows get focused.
Documentation - https://developer.apple.com/documentation/appkit/nsrunningapplication/1528725-activatewithoptions