BUG: objToJson.c - fix return value
- [x] closes #31463

https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=27217&view=logs&j=3a03f79d-0b41-5610-1aa4-b4a014d0bc70&t=fe74a338-551b-5fbb-553d-25f48b1836e8&l=687

Seems like this warning is somehow causing an error in the users builds of pandas