Moderator Action: Merged with existing Bug Report thread.
It appears you are experiencing the bug discussed in this thread. As noted by liv, you have probably unlocked the Civil Engineering civic, which gives each city maximum fortifications and the ability to bombard, and also obsoletes all walls and eliminates the project to repair outer fortifications. But if any city has ancient walls that are damaged (and not yet repaired) prior to unlocking Civil Engineering, that city will show city fortification health that is less than 200 (e.g., 197/200 or some such) and the game will present building medieval walls as a grayed out build option (even though you cannot build any more walls, ever), while saying you need ancient walls (which exist, but are damaged and cannot be repaired).
It appears you are experiencing the bug discussed in this thread. As noted by liv, you have probably unlocked the Civil Engineering civic, which gives each city maximum fortifications and the ability to bombard, and also obsoletes all walls and eliminates the project to repair outer fortifications. But if any city has ancient walls that are damaged (and not yet repaired) prior to unlocking Civil Engineering, that city will show city fortification health that is less than 200 (e.g., 197/200 or some such) and the game will present building medieval walls as a grayed out build option (even though you cannot build any more walls, ever), while saying you need ancient walls (which exist, but are damaged and cannot be repaired).