Read the illustrated path
Our transition demo separates melding the entire Hand from discarding its final card. Follow the selected path and the current stage label rather than assuming that an empty Hand always means the same timing.
Check the actual rules
The demo is based on a named partnership account and assumes the action was legal. It cannot decide whether your real meld meets the conditions or whether your app uses the same procedure.
Keep the end of round separate
Starting the Foot is not a declaration that you may go out. Read the complete ending conditions before resolving that question.