Answer in Five Parts
Part One: Co-orbital Planets, Problem No Shadows
It is possible to have two planets in a synchronised orbit if they share the same orbit at the same distance from the star in their system. Thus they will always be the same distance from the star and from each other. And since they will both be the same distance from the star one will not cast a shadow on the other.
For discussions of planets sharing the same orbit around their star, go to the PlanetPlanet blog, and the section The Ultimate Solar System, dedicated to the theoretical design of statistically improbable but scientifically possible solar systems with as many habitable planets as possible.
https://planetplanet.net/the-ultimate-solar-system/[1]
The various posts in that section usually increase the number of planets in the circumstellar habitable zone by using co orbital planets sharing the same orbit with the same distance from the star.
Part Two: The L2 Point, a Possible Solution
Another way to get two planets to stay in the same position relative to each other is to put them in their Lagrange points relative to each other.
Each astronomical object which orits a more massive orbit has five Lagrange points where a body would stay in the same position relative to it.
https://en.wikipedia.org/wiki/Lagrange_point[2]
the L1 point for an orbiting object is between that object and the object it orbits, and the L2 point is on the far side of the orbiting object, so that any object in the L2 point will always have the orbiting object between it and the star or other object they orbit.
Of course all known examples of objects in the Lagrange points are very tiny compared to the other objects in the system. If the perpetually shadowed planet in the l2 position was approximately Earth sized, the planet which shadowed it would have to be a giant planet or even a brown dwarf, orbiting a star.
The planet Jupiter has about 318 times the mass of planet Earth. The limit between giant planets and brown dwarfs is about 13 times the mass of Jupiter, and the limit between brown dwarfs and extremely low mass stars is about 75 to 80 times the mass of Jupiter. So a giant planet could have up to about 4,134 times the mass of earth, and a brown dwarf could have up to about 23,850 to 25,440 times the mass of Earth.
A low mass star would illuminate the shadowed planet, possibly a lot more than the more distant star would, so the planet would not be very dark. Even some brown dwarfs might illuminate the shadowed planet with some visible light.
So a giant planet or brown dwarf could have an approximately Earth sized planet in their L2 position, and cast a shadow on the planet in their L2 position.
Part Three: Problems with the L2 Situation.
Problem One:
Objects in the Lagrange points tend to oscillate around those Lagrange points and so an object in a L2 point would probably pass in and out of the shadow cast by the large planet, as that object oscillates around the exact L2 point.
Problem Two:
And of the five Lagrange points, only two, the L4 and L5 points, are very stable. They are 60 degress ahead and behind the object they are orbiting with, and so are examples of co orbital objects, like I mentioned at the beginning, sharing the same orbit and having the same distance from their star.
So if a planet was in the L2 position of a larger planet, it would not be there for billions of years, but for a much shorter time span. People on the L2 planet might remember the time before it entered the L2 position and was cast in shadow.
Problem Three:
And a third problem is the size of planets and the distances between them. In our solar system the distance between planets are so vast compared to the sizes of the planets that no planet in our solar system can cast a full shadow on another planet.
The shadows of planets consist of the umbra, the full shadow, and the penumbra, the lesser shadow. A total eclipse of the Sun is when the Earth is in the umbra of the Moon, and all the sunlight is blocked. The umbra is a cone which narrows with increasing distance from the planet and eventually ends in a point ata suficient disance.
The penumbra cast by an astronomical object is not nearly as dark as the umbra. It is a cone which gets wider and wider and less dark with increasing distance from the planet and extends to infinity.
In our solar system all the planets are so small compared to the distances between them, that they can only cast their penumbras and not their fully dark umbras, upon other planets.
Problem Four:
And the planet Jupiter is almost as large in diameter as a planet can get. If mass is constantly and slowly added to a planet like Jupiter, that planet will get larger and larger for a while, and then it will cease to expand no matter how much matter is added to it. When the mass of a planet increases beyond a certain point, the planet will begin to shrink in size as it becomes more compressed.
I have read that giant planets like Jupiter, brown dwarfs, and even low mass stars do not vary in diameter by more than about 15 percent, and that some low mass stars are even a little smaller in diameter than Jupiter.
Part Four: A Partial Solution to L2 Problems:
But astronomers have now discovered a few thousand exoplanets orbiting other stars, including hundreds of systems with two or more planets. Those solar systems around other stars vary greatly in many aspects, including the distances between planetary orbits.
The TRAPPIST-1 system has a number of planets, some in the circumstellar habitable zone of the star TRAPPIST-1, which orbit very close to that dim star and thus very close to each other.
The orbits of the TRAPPIST-1 planetary system are very flat and compact. All seven of TRAPPIST-1's planets orbit much closer than Mercury orbits the Sun. Except for b, they orbit farther than the Galilean satellites do around Jupiter,[43] but closer than most of the other moons of Jupiter. The distance between the orbits of b and c is only 1.6 times the distance between the Earth and the Moon. The planets should appear prominently in each other's skies, in some cases appearing several times larger than the Moon appears from Earth.[42] A year on the closest planet passes in only 1.5 Earth days, while the seventh planet's year passes in only 18.8 days.[40][37]
https://en.wikipedia.org/wiki/TRAPPIST-1[3]
So it is quite possible that the outer TRAPPIST-1 planets often pass into darker parts of the penumbras of planets orbiting closer to TRAPPIST-1 than they do, and maybe even pass into the totally dark umbras of the interior planets.
So in a system like TRAPPIST-1 in some ways, with the planets orbiting very close to the dim star, some of the TRAPPIST-1 planets might be replaced by a giant planet and a roughly Earth-sized planet in the L2 position relative to that giant planet, and maybe the L2 planet would be in the shadow of the giant planet.
Part Five: Consequences for Life on the L2 Planet
But since the L2 position is not stable for long times, the L2 planet would have wandered into and been captured in the L2 position rather recently by astronomical or geological standards, and would be expected to leave the L2 position soon by astronomical or geological standards, and then either:
Collide with another planet and be destroyed.
Fall into the star and be destroyed.
Be ejected from the star system and gradually freeze in interstellar space far from the heat of any star.
Enter a new and rather eccentric orbit in the star system. The planet would be in constant danger of experiencing alternatives 1, 2, or 3 due to destabilizing interactions with other planets in the system.
So if there is life, and especially intelligent life, on the L2 planet, they have a lot to worry about, freezing as long as they are in the L2 position and the shadow of the giant planet, and possible destruction once they leave that L2 position.