This is probably the single most common problem that occurs on 240 wagons.
To fix it, remove the rear dome light and handle, pull the rear edge of the
headliner off the lip, then mark the position of the hinges with a dry erase
marker and while two helpers hold the hatch, remove the gas shocks and then
remove the two bolts from each side that hold the hinges to the roof. Set
the tailgate on a padded surface and remove the hinges and upholstery panel.
You should be able to pull the new wiring harnesses (available online) in
with the old ones.