If have an employment visa and have stopped working for your sponsoring employer, no matter what the reason, you will not have to leave Hong Kong straight away.
The HKID provide you with enough time to make arrangements to find an alternate employer or, if you prefer, to lay the groundwork to start your own business.
Ninety-nine per cent of the time, the Hong Kong Immigration Department will allow you to carry on living in Hong Kong until your current visa expires but you’re expected to leave at that time.
But if you find another employer or have made ready to start your own business you can apply for new visa permissions to continue living and working in Hong Kong – and get a 12 months extension to your present period of stay in the process.
But in either case you have to make the applications and get the Hong Kong ID’s approval before you start working – otherwise you’ll be breaking the law.