I have been at the bedside of many, many people at their exact moment of death. Those people have taught me what happens in the hours to minutes before death. Just before they take their final two or three breaths most people make a facial grimace or frown. Once in a while I have seen a smile but usually it is a grimace. My belief, and I can not prove this in anyway, is that the frown or grimace is made at the actual moment the soul leaves the physical body, the exact moment the driver gets out of the car. Following the facial movement there are usually two or three long spaced out breaths, the rest of the air and energy leaving the body. I don't think the facial expression has anything to do with pain or discomfort. It may show a bit of ambivalence about leaving this world but mostly I think it is the expression of release, of the final letting go from the physical body.
When people are heavily medicated during their last hours to minutes they don't seem to show the grimace but either way, grimace or not, nothing bad is happening, nothing out of the ordinary is happening. The person has let go of the hold on the physical just like they are supposed to do. They are now free to go about a new journey. We often get very confused about the moment someone takes their last breath. We let our own fear of the moment distort our perception of what happened. We tend to put way too much thought into what the last moment looked like.
Please celebrate life, the joys, the legacy your loved one brought to the physical world. Fill your mind with good memories and let go of your concern for the moment of release. A death in this world is a birth into another world. You have witnessed a birth and the labor it entails.