Its not totally clear what you are doing.
Are you explicitly handling transactions in MF with Start and end transactions? If Yes, why do you want to do, for the scenario, you explained above.
You pass the JSON from Java action to MF and probably using import mapping to convert the JSON to objects of specific entity. But, when doing the import mapping, are you committing the processed objects automatically within the import mapping? OR atleast commit them outside after some post processing.
https://docs.mendix.com/refguide9/import-mapping-action/#commit
If there is an exception, I suspect, that could possibly happen within the Java action that calls the MF or if there are other java actions within the MF to process data, it is easy to handle them yourself and log them with some custom log node.
If you dont log anything and leave it for default behavior, then obviously there will be a rollback, in which case, you should be looking at the application logs to know more about error happened. Because there will be stack trace for sure.
Mendix handles the transactions by itself for every MF. Its better to not intervene unless we know what we are doing and only if its required.