Hi Abhimanyu,
In case it is a BP that you want to create with the API framework: Guess it is related to a missing BP_GUID entry in entity BP_HEADER.
Check BP_HEADER check table (with USMD_DATA_MODEL) and compare BPs that you've created with the UI and those you've created with the API framework.
This missing BP_GUID will cause the error message (and navigation to the search screen).
Normally the BP_GUID is created by the BP application. I'm not sure if this is a problem between API framework and BP application or if it is another method that has to be called for creating the BP_GUID.
I'd be glad to get feedback on this - as I got stuck at this point.
Cheers