Now you know that in weakness [astheneian] of the flesh I proclaimed the gospel the first time to you [Berean Literal], and you did not despise that which was a trial to you in my bodily condition, nor express contempt [NAS] ...
I think this is the same "weakness" that Paul talks about in 2 Cor. 12:7-10 (which he extends to include all of his sufferings).
So to keep me from becoming conceited, I was given a thorn in my flesh, a messenger of Satan, to torment me. Three times I pleaded with the Lord to take it away from me. But He said to me, “My grace is sufficient for you, for My power is perfected in weakness [astheneia]." Therefore I will boast all the more gladly in my weaknesses, so that the power of Christ may rest on me. That is why, for the sake of Christ, I delight in weaknesses, in insults, in hardships, in persecutions, in difficulties. For when I am weak, then I am strong.
And as noted here regarding the meaning of "messenger" in 12:7:
(ággelos) is used 176 times in the NT (usually of heavenly angels), but only the context determines whether a human or celestial messenger is intended.
https://biblehub.com/greek/32.htm
In this context I think the "messenger" is an angel given the association with Satan (as per Mt. 25:41:"Then He will say to those on His left, ‘Depart from Me, you who are cursed, into the eternal fire prepared for the devil and his angels'").
And I think Paul is the one who had the revelations he describes in 12:1-4. It strikes me as false modesty, since his whole thing is about God's power being "perfected in weakness."
If James if the one who had these revelations, how does that square with the idea that Paul thought of him as a messenger of Satan, when he says "I will boast about such a man" who had the revelations in 12:5-7? How can the same person be someone Paul would boast about and a messenger of Satan?
I will boast about such a man, but I will not boast about myself, except in my weaknesses ... But I refrain, so no one will credit me with more than he sees in me or hears from me, or because of these surpassingly great revelations.
Why would Paul worry about being credited for "these surpassingly great revelations" if he's not the one who had them? And what would he have to be "conceited" about if not "surpassingly great revelations" when that's the only thing he mentions in 12:1-6?
So it looks to me like Paul is trying to have his cake and eat it too here. He wants people to know in an indirect way that he had "surpassingly great revelations" (as per Gal 1:11-12: "For I certify to you, brothers, that the gospel I preached was ... received ... by revelation from Jesus Christ") and would boast about "such a man" who had them, but he also believed that God's power was "perfected in weakness" and prefers to boast "all the more gladly" about that.