The spell 9th-level Sor/Wiz spell astral projection [necro] (PH 201) is one of those high-level legacy spells dating back to at least Advanced Dungeons and Dragons (1978), likely included in Dungeons and Dragons, 3rd Edition and its offspring with the understanding that no one would ever actually use it. Nonetheless, let's say a creature does use an effect like the spell astral projection--for the sake of argument, a demilich, who can use such an effect will as a spell-like ability.
The spell says
By freeing your spirit from your physical body, this spell allows you to project an astral body onto another plane altogether.
You can bring the astral forms of other willing creatures with you, provided that these subjects are linked in a circle with you at the time of the casting. These fellow travelers are dependent upon you and must accompany you at all times. If something happens to you during the journey, your companions are stranded wherever you left them.
You project your astral self onto the Astral Plane, leaving your physical body behind on the Material Plane in a state of suspended animation. The spell projects an astral copy of you and all you wear or carry onto the Astral Plane. Since the Astral Plane touches upon other planes, you can travel astrally to any of these other planes as you will. To enter one, you leave the Astral Plane, forming a new physical body (and equipment) on the plane of existence you have chosen to enter.
While you are on the Astral Plane, your astral body is connected at all times to your physical body by a silvery cord. If the cord is broken, you are killed, astrally and physically. Luckily, very few things can destroy a silver cord. When a second body is formed on a different plane, the incorporeal silvery cord remains invisibly attached to the new body. If the second body or the astral form is slain, the cord simply returns to your body where it rests on the Material Plane, thereby reviving it from its state of suspended animation. Although astral projections are able to function on the Astral Plane, their actions affect only creatures existing on the Astral Plane; a physical body must be materialized on other planes.
You and your companions may travel through the Astral Plane indefinitely. Your bodies simply wait behind in a state of suspended animation until you choose to return your spirits to them. The spell lasts until you desire to end it, or until it is terminated by some outside means, such as dispel magic cast upon either the physical body or the astral form, the breaking of the silver cord, or the destruction of your body back on the Material Plane (which kills you).
Assuming the demilich's extraordinary ability magic immunity allows it even to use its spell-like ability astral projection on itself,1 can the demilich use its astral projection ability only while on the Material Plane and its (remaining) body (part) can't be moved from the Material Plane without ending the astral projection effect, or is the Material Plane used in the spell description a placeholder for whatever plane the demilich is on when he employs his astral projection ability?
(If it makes a difference, the Pathfinder spell lesser astral projection assumes the latter, although its astral projection spell is identical to the above.)
1 Whether a demilich can use its spell-like ability astral projection is its own question here.