He walked up on the wall to the roof against the gravity.
He walked up on the wall to the roof despite the gravity.
壁を歩いて屋上まで上る
登るというイメージを表すためにupという副詞を加えてみました。
また、重力を無視してという言い方を、重力に反してと表現しています。
against ~に反して、despite~にかかわらず
He walked up on the wall to the roof against the gravity.
He walked up on the wall to the roof despite the gravity.
He walked up the wall to the roof, defying gravity.
「壁を歩いて屋上まで上る」を表現するために、"He walked up the wall to the roof, defying gravity." と言います。"walked up the wall" は「壁を歩く」、"to the roof" は「屋上まで」、"defying gravity" は「重力を無視して」という意味を持ちます。
「defying gravity」という表現は、重力に逆らう様子を強調し、特にSFやファンタジーの設定によく使われます。