The Facts:
About 40 ft
Occured at depth, not during ascent or descent
descending did not clear problem
ascending did not clear problem
ear equalizes fine " or appears too"
was the 2nd dive of the day "shallower then first dive"
Wow, that's not the typical barotrauma story..! Basically, a symptom that reproducibly happens at depth is almost always related to pressure change (with a rare exception being a temperature related problem that happens when you hit a thermocline).
From your post, I understand that the symptom happened again when you tried to free dive after a week. Do you mean that the symptom happened at 40 feet, then eventually went away after the dive, then came back a week later when you dove again? Or do you mean that it happened at 40 feet and then just never went completely away? I am assuming for this discussion that we are not talking about a contact with a jellyfish or something that caused a skin reaction, but rather a reproducible symptom related to depth...
In order for there to be symptoms related to pressure, there has to be gas involved, since everything else in the body (muscle, bone, blood, etc...) acts like a fluid at depth - that is to say, not compressible to any significant degree. So there is little effect of ambient pressure, or ambient pressure changes, on anything that isn't filled with a gas.
The ears are the space that most commonly has issues with ventilation, but of course we all know the dangers of not equalizing pressure in the airway (breath holding during ascent). Less common sources of symptoms related to pressure changes would be air trapped in the sinuses or around teeth. Tooth squeeze is a particularly difficult problem, since you can usually equalize the spaces in your ears and sinuses with the gas in your airway (which matches ambient pressure, due to the regulator). An exam (possibly including a CT scan) would identify any trapped air pockets in the area that is causing your symptoms, such as the teeth, jaw, skull, etc. Occasionally there can even by small air-filled cysts in unanticipated places.
The one thing that is not typical of these types of problems would be the fact that your symptoms do not seem to be affected by ascent or descent. However, if the gas filled space is truly not in good communication with the airway, then you would not expect the pain to change quickly with ascent or descent, so it might just be a question of a delay in the time it takes for the pressure gradient to naturally resolve.
The localization of the symptoms is less mysterious, as pain in the head and neck region is often "referred", presenting is places different from the source. This is because the sensory nerves of this area are dense and interconnected.
Keep us posted, let us know when you get more information...! What kind of doctor are you seeing for this? You might want to see someone with dive medicine experience, and an ENT doctor would be a good choice for this type of issue...
Best,
Mike