The key legal difference is whether the obligatory final sitting occurred:
• Omitted it, then rose for a fifth: return before its prostration; after its prostration, the fard is lost.
• Completed the final sitting, then rose by mistake: the essential sitting was already fulfilled, changing the status of the extra rakah.