HitObject.MakeHit fails to compile when the target is set to sm_6_8. It's likely because of an issue in the NVAPI headers. It looks like the struct here needs the [raypayload] attribute.
Refer - https://microsoft.github.io/DirectX-Specs/d3d/Raytracing.html#hitobject-interaction-with-payload-access-qualifiers
The solution looks like -
struct [raypayload] NvHitObjectMacroDummyPayloadType { int a : read(caller) : write(caller); };