If the wall was more than 3m from the court, my understanding is that this is a legal play. The important rules here are Rule 1, "Playing Area":
The playing area includes the playing court and the free zone
The playing court is a rectangle measuring 18 x 9 m, surrounded by a
free zone which is a minimum of 3 m wide on all sides.
The free playing space is the space above the playing area which is free
from any obstructions.
Note that this means that there cannot be any walls etc in the free zone, as that as part of the playing area. Next see Rule 9.1.3, "Assisted Hit":
Within the playing area, a player is not permitted to take support from a
team-mate or any structure/object in order to hit the ball.
(my emphasis). Outside the playing area, it is allowed to take support from structures or objects, and this is allowed by referees in accordance with the principle of "keep the ball flying".
If the wall were within the 3m free zone, then the venue would not be a valid location to play volleyball under FIVB rules. Some leagues I've played in have explicit local rules for this kind of situation (which is good and makes the question answerable: read the local rules), others have relied on the interpretation of the referee (which is slightly less good).
(All rules quotes from the 2017-2020 Rules)