Unveiling the double-well energy landscape in a ferroelectric layer