Go to AndroidManifest.xml and make sure that the relevant activity has the following intent-filter added:
<intent-filter>
<action android:name="androidx.health.ACTION_SHOW_PERMISSIONS_RATIONALE"/>
<category android:name="android.intent.category.HEALTH_PERMISSIONS"/>
</intent-filter>