If you are using the SC Form Procedure options under the form settings, make sure that your stored procedure is returning the primary key at minimum. Ensure your primary key is selected under the SQL settings. Also ensure that if you are calling your form via a link other than an Edit Link Under application links) and calling a form from say a Button or grid action button, that you set the link settings correctly to be inline with your form settings.
If you are doing stored procedure calls within a OnAfterInsert or OnAfterUpdate that requires the form primary key as foreign key value, remember to do a sc_commit_trans() before doing your call. On these events the field values and primary key will already be available for use but cannot be modified and can be accesed with SC {} notation. The commit happens directly after the event, so if you do a procedure call, from your db’s perspective, the record cannot be found as SC has not committed the transaction and your stored procedure call will fail, in most cases do sc_commit_trans() and then do the call / sc_redir() or any others. The sc_error macro’s is still usable in these events if you have not done a sc_commit_trans and can role back the transaction.
In your situation, I would enable debug under your forms Application settings to see the sql being processed, it will give you a good indication on what is going on and where to do a fix, either on the SC side, or your stored procedure.