Hydrangeas can flower with little amounts of dappled sun. I learned that from watching a mophead that my sister's neighbor had and which I originally thought would not bloom or would not bloom well because I typically saw it when shaded. Now I have a Pee Wee (oakleaf) under a holly tree that gives it a tiny bit of dappled sun during the 12pm hour; on the east side, the holly tree has another holly tree which blocks a lot of the sun; Pee Wee has another dense holly on its west side and a tall wooden fence on the south so sunlight can only come -indirectly- from the northern side.... yet it blooms very well too.
Have you "measured" from when to when does it get sun? Dense shade would start to produce issues. Another suggestion: post pictures of the location when it is getting sun and shade. Indirect sunlight is as good as direct sun, which is why I suspect the shrub is producing flower buds. Also, consider the possibility of having too much fertilizer that I previously mentioned.
Conventional hydrangeas like mopheads- would also not bloom if pruned in autumn, although there are some newer varieties that bloom on old and new wood. Those, if they pruned in autumn, will not bloom in early Spring but will produce blooms later from new wood.