There might be an issue with your Apple Health permissions.
Open the Apple Health app, tap on your profile picture, then tap on Apps in the Privacy section.
Tap on None to Run and make sure all the switches are on (green) for writing and reading data (need to scroll down).
Also, open the iOS Settings app, tap on None to Run and grant all permissions there as well. Make sure that "Location" is set to "While Using the App".