Hello @Shradha Pokhriyal,
Thank you for reaching Microsoft.
The error code "19999" for OneNote represents - The request failed because an undetermined error occur, also, the 500 error is a server-side error. This could be due to various factors, including internal server errors, an incorrect API request format, or problems with the requested resources. If the error occurs occasionally and the request is successful upon retry, it might indicate a temporary server issue or a transient network problem.
There is no universal solution to this error, if your request format and access token are correct, then checking your server and retrying would be the first thing you should do.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.