I've read comments that naval gunfire wasn't much use in indirect fire mode as the guns had a fairly flat trajectory designed to hit the sides of ships, not up and over cliffs etc.
Flat out not true. Angle of fall is range dependant for each cannon, projectile, and propellant charge type. At relatively close ranges of under 5,000 meters the angle is under 270 mil or 15 degrees & the number of ricochetts increases. The result of these depends on fuse type. Some detonate on impact anyway, some a little past the impact zone & create a airburst over the target, others burst far past or fall intact past the target. that the ground was rising from the water line to well inland the relative angle of impact was usually larger than 15 degrees.
I also read that the naval gunfire on D-Day had little effect as it either missed its targets or the concrete emplacements were able to resist it, ...
That is only partially correct for the planned fires mostly fired before the landing. The 40-90 minutes of prelanding fires on the beach defense seem to have inflicted about 5% losses on the defense. That is typical for such preparation fires of this duration. In the modern artillery lexicon I was trained in this is part of the defnition of 'Suppresive Fires', that is 1% to 5% casualties. On some of the beaches the defense loss was a little more, approaching 10%, on others less closer to 2% or less.
Once the landing commenced the NGF changed to either fires under the control of onshore spotting teams, or planned fires inland. The latter were vs suspected artillery positions, HQ, reserves, road junctions. The priority was to targets identified by onshore spotting teams. The greater accuracy of observer spotted fire missions vs planned targets and the caliber of ammunition placed these Naval Gunfire attacks in the "Nuetralization" class. That is the casualties range from 5% up to 15%, and the men in or adjacent to the impact area are stunned or concussed for some time after the attack ceases. When temporary hearing loss and temporary concussion effects are included the larger caliber 15 & 20 cm naval projectiles can inflict over 50% temporary casualties to men in 60 to 120 second of fire. Tank armor is only a partial protection from concussion. A 20cm naval or field artillery projectile detonating adjacent to a modern tank will usually leave the crew with some hearing loss & at least mild concussions for some minutes after the explosion.
... and the most useful gunfire was from destroyers coming in close providing direct support.
Destroyers were assigned to respond first to ashore spotting teams targets on or adjacent to the beach. This had to do with danger zones for larger 15 & 20cm projectiles causing losses to friendly assault units only 100-300 meters from the target. The 12 cm caliber destroyer guns were more appropriate to these close in targets.
It seems that the experience was different on different beaches and also it seems to vary according to British and American sources. Then I read how effective naval gunfire was in breaking up a counter-attack by the Panzer Lehr division. So how effective was it really?
5% or less of the naval ammunition used in the Normandy battle was fired in the planned landing preparation fires. The balance was used in controlled attacks by spotting teams after the beach assaults.
After 6th June most of the NGF attacks were spotted by trained observation teams, accurate, and in time with the ground forces needs. Rommels opinion was the Allied NGF was one of the decisive factors in the loss of the beach head and inland battle. Few of the German defenders in Normandy had any experience with naval gunfire. The lessons of Sicilly, Messina, Salerno, Anzio, ect... were not clearly asorbed by the German leaders in France. The volume of the NGF and effects were a suprise to them.