It seems like KMAC implementation on Linux uses EVP MAC APIs which is good.
The HMAC implementation seems to use obsolete HMAC_ APIs, which will be removed soon. And in 3.0.0 are wrappers around digest API.
The issue is that HMAC APIs bypass provider framework and checks available there.
In certain configurations MD5 can be allowed as digest, but blocked as HMAC.
This works correctly in python (which uses EVP APIs for hash and HMAC), but not with dotnet right now (which uses EVP digest effectively for both hash and HMAC).