the coastal fortes bombards passing hostile ships. But the AI will just go around the coastal fortress, out of its range. So no AI ship will end up damaged by it.
Now this could hypothetically still have been useful if you can use it to prevent the AI from landing somewhere, but the range of the CF is 1 tile. Also it only works on passing ships, it doesn't work for ships that move directly at the city. (just like zone of control)
And if you where expecting it to defend against amphibious attacks, you where expecting wrong, it doesn't.
So that are 40 shields that could better be invested in cannons, you can use those to actively bombard enemy ships near the coast, on any place near the coast.