DirectX9 CreateDeviceEx fails with D3DERR_NOTAVAILABLE

On creating and destroying DirectX9 device repeatedly after some time the CreateDeviceEx call fails randomly with the error : 0x8876086A (D3DERR_NOTAVAILABLE)

On enabling Debug spew on debug directX binaries, I see the following log when the CreateDeviceEx call fails :

Direct3D9: (ERROR) : DDraw and Direct3D are not supported in less than 8bpp modes. Creating Device fails.

Moreover, if it helps, I get this error only on laptop, not on my desktop computer running on similar configuration.

Any clue as to what maybe going wrong ?

I am using latest Windows 10 release and GTX-980 (desktop) / GTX-1060 (Laptop) with latest graphics drivers.