why was the former rejected and the latter accepted?
First of all, the latter was not accepted. That is, it did not go through a review process. At >2k users have earned the privilege to edit without an explicit review. But given that edits bump the post, it is brought to the attention of the community. The editor is clearly indicated in the post and clearly visible in the revisions. As a result of that, such edits are not without their review, even when they don't pass through a dedicated queue. If the editor does harm, their edits can be rolled back. So all in all, there is no real problem here that needs any action.
I could hardly make proper sense out of the given for rejecting the former
As for the former edit, you changed code. That is, you made the answer something it was not. That might be a great correction of the code, and not a wrong edit in that sense. But the community has long settled on not touching code, but rather leaving comments for the author to fix it. Which is something you did as well, and more than likely why the author made the correction. That is the correct approach to such edits. So well done there. In addition, your edit comment is not very descriptive, making such edits even less likely to be accepted.
what happened to those principles in case of the latter?
Coming back to the latter example, if the editor would have made this a suggested edit, I would have rejected it for the exact same reasons. Given that you however explicitly approve of the edit, we can leave it as it is.
In conclusion, there's not really an inconsistency here since the situations are different from the start.
How can I find out who took part in the edit review process of a particular edit? Couldn't find out for the latter.
Go to the "suggested edit" page of that particular edit. You can find a link in the revision history. There you can see who participated in the review and how they voted. I guess you understand why there is no such page for the latter edit.