@Quappi did you make sure to enable HealthKit Background Delivery in your Signing & Capabilities tab? I don't remember off hand if you try to enable via code and don't have this setting enabled if you get errors or not.
This would be the first thing that I would double check. You should also check the docs about background delivery, not all types deliver in the background immediately.
Topic:
App & System Services
SubTopic:
Health & Fitness
Tags: