Prof. Dr. Chandradhar Sharma gives an excellent writing on this often confusing aspect of Advaita in his book The Advaita Tradition in Indian Philosophy: A Study in Buddhism, Vedanta and Kashmira Shaivism. He goes through the sometimes technical details over many pages. In one section (pp 181-183) he writes:
Some critics have often failed to understand the significance of avidya or maya and have, therefore, charged Shankara with explaining the world away. Shankara himself raised such objections as purvapaksa and has answered them. It is that most of the critics have not considered his answers. They say: If the world is unreal, unreal means like Vedanta texts cannot lead unreal personalities to attain real liberation; if the world is real, it cannot be maya (footnote: see Shankara's Brahma Sutras II.1.14 commentary here - https://www.wisdomlib.org/hinduism/book/brahma-sutras/d/doc62753.html). A philosophy which has nothing better to say than that unreal personalities are unreally striving in an unreal world through unreal means to attain an unreal end, is itself unreal. Verily, one bitten by a rope-snake does not die nor can one use mirage water for drinking or bathing (again Brahma Sutras II.1.14). The Acharya replies that such objections are based on a confusion between the empirical (vyavahara) and the transcendental (paramartha). The opponent is hopelessly confusing the empirical with the transcendental, even as he is confusing the illusory with the empirical. The falsity of the illusory can be realized only when empirical knowledge is attained. The 'rope-snake' generates fear and an attempt to avoid or kill it and is realized as illusory only when the rope is known. The dream-water quenches dream-thirst. The roaring of a dream-tiger generates fear. Dream objects can be discarded as false only when the dreamer gets awake. Similarly, the unreality of this empirical world can be realized only when the Absolute is attained. The Acharya says: We have repeatedly asserted (asakrdavochama) that as long as the transcendental unity of the self with Brahma[n] is not realized, the entire world must be taken to be true (Again same Brahma Sutras verse). As long as this knowledge of unity does not dawn, all secular and religious practices stand as real (again same Brahma Sutras verse). Before Brahma[n]-realization, the world cannot be condemned as unreal. Thought reigns supreme in the empirical realm and its authority cannot be questioned here, otherwise the entire empirical life would be exploded (Brahma Sutras II.1.11). It is only when the the unity of Brahma[n] is attained, the Vedanta declares the world to be unreal. This transcendental knowledge cannot be dismissed as subjective or imaginary, for it is directly experienced as unity with the Real, and it results in the total cancellation of avidya along with its products, and itself cannot be contradicted by any other knowledge (Brahma Sutras II.1.14).
From the above it is clear that Shankara is emphatic on preserving the empirical validity of the world. Far from taking away the reality of the world, Shankara grants some reality, during appearance, even to illusory objects which according to his opponents are unreal. The words 'real' and 'unreal' are used in Vedanta in their absolute sense. 'Real' means real for all time and Brahma[n] alone is real in this sense. Similarly, 'unreal' means utterly unreal like a sky-flower, which this world is not. The world is 'neither real nor unreal' and this brings out the indefinable and self-contradictory nature of this world. It has empirical validity, but not ultimate reality. When the 'reality' which is denied to this world means 'reality for all time', the 'unreality' which is attributed to it means 'non-eternality'. Who can say that the world is not 'unreal' if 'unreal' means 'temporal'? It is true for all practical purposes. It will be sublated only when knowledge dawns and not before. This should make us humbly strive after true knowledge rather than engage ourselves in futile quarrels. Acharya Shankara's intention is perfectly clear--none can condemn this world as unreal; he who does it is not qualified to do so and he who is qualified to do so, will not do so, for he would have risen above language and finite thought. Nobody can make the unreal real or transform the real into unreal. The world is what it is, neither more nor less. Its reality is Brahma[n] which is its underlying ground; its unreality consists in its ascribed characters which are superimposed on Brahma[n]. When Brahma[n] is realized superimposition is rejected and the ground is reinstated. The Real is ever what it is. It is only avidya that appears and avidya that vanishes.
As Swami Vivekananda says (Complete Works, V7, p 33):
The world is God and is real, but that is not the world we see; just as we see silver in the mother-of-pearl where it is not. That is what is known as Adhyasa or superimposition, that is, a relative existence dependent on a real one..."taking a thing for what is not'. We see reality, but distorted by the medium through which we see it.
And in V6, p 92, he says:
Maya is not illusion as it is popularly interpreted. Maya is real, yet it is not real. It is real in that the Real is behinnd it and gives it its appearance of reality. That which is real in Maya is the Reality in and through Maya. Yet the Reality is never seen; and hence that which is seen is unreal, and it has no real independent existence of itself, but is dependent upon the Real for its existence.
Maya then is a paradox-real, yet not real, an illusion, yet not an illusion.
He who knows the Real sees in Maya not illusion, but reality. He who knows not the Real sees in Maya illusion and thinks it real.
And as Krishna says in the Gita 9.4-6 (Swami Nikhilananda translator):
By Me, in My unmanifested form, are all things in this universe pervaded. All beings exist in Me, but I do not exist in them.
And yet the beings do not dwell in Me--behold, that is My divine mystery. My Spirit, which is the support of all beings and the source of all things, does not dwell in them.
As the mighty wind blowing everywhere ever rests in the akasha, know that in the same manner all beings rest in Me.
So Ramana Maharishi's statement is correct and in complete agreement with both Shankara and Krishna.