Inaccurate Samsung Health data and missing activities like distance

Samsung Health is officially syncing data with Health Connect, but some activities, such as distance, are not appearing in Health Connect. Moreover, when my app retrieves data from Health Connect, the Samsung Health data is inaccurate and shows less information than expected.