After entering Capital Gains and Foreign Capital Gains correctly Turbotax returns an error:
Your foreign capital gains cannot exceed your total capital gains.
The sum of box 52 and box 53 must equal the total capital gain or loss in box 21.
The sum of Box 52 and Box 53 does equal Box 21.