God completely ignores any and all context of 'trial' and 'defense' and 'accusation' by His very person implicitly declaring any such pretense to be wicked.
Elihu presages the very same thing by declaring it explicitly ((37:19-20))
restating God's own dismissal of the very idea of the legitimacy of any accusation against Him or account being demanded of Him ((Isaiah 43:13)) to which Job confesses & acquiesces ((9:12, 42:2)), Elihu attests ((36:22-23)), the prophets & wisdom bear witness ((Daniel 4:35, Psalm 115:3, 135:6, Isaiah 14:27, 45:9, Ecclesiastes 8:4)), is hardly to be characterized as 'grasping at straws'
God does not even stoop to entertain the idea of there being any sort of 'trial' going on either of Him or of Job - He silences & humbles Job - the very things Elihu tries to persuade the four of them of, for the very same reason: His sovereignty - and actually characterizes Job's ordeal as having to do with salvation ((40:8-14))
and again, Job begins the discourse proclaiming his innocence ((6:24-30, 7:2-21)) -- so by your argument, all three of his friends "sin" by violating Babylonian decorum.