NCrypt API NCryptCreatePersistedKey fails when NCRYPT_MACHINE_KEY_FLAG flag is used

We are trying to use NCrypt APIs to perform encrypt and decrypt of data.
We are using these APIs in C++ static library which is consumed by Winrt component which is eventually consumed by C# UWP app
UWP App --> WinRT COmponent --> C++ static lib
we are using the below APIs in the C++ static lib.
NCryptOpenStorageProvider - with MS_PLATFORM_CRYPTO_PROVIDER ( we need to use this with TPM only)
NCryptCreatePersistedKey - with NCRYPT_OVERWRITE_KEY_FLAG | NCRYPT_MACHINE_KEY_FLAG flags
if we use NCryptCreatePersistedKey with dwFlags as 0 (i.e current user) it works fine.
if we use NCryptCreatePersistedKey with dwFlags as NCRYPT_MACHINE_KEY_FLAG, the API fails.
It would be great if anyone can help with this