Roof lining, I don't think so but I could be wrong. Although I do remember a guy here ages ago got a warning by the police because he took the door trims off his car for some reason then got pulled up driving it before he put them back in. I think that was in the paint your car with rollers thread.
Yes It is indeed illegal in NSW to have no roof lining, Mrs got pulled over due to the lining just let go on her way home from work one night, and said fix it, She asked if she could just remove it but apparently its a fixture to the car and must be in place, and that the old foam can fall into your eyes etc lol, and was told if its not fixed the car will be defected. So i just ripped the roof out and re-stapled & Glued the same piece back on. She was then pulled over again and said good to see it was fixed.
I drove around with no lining for a few weeks while I was fixing the roof and didn't get pulled over so not too sure on the legalities but I reckon the only thing it would be is in the case of an accident you could hit your head on some of the metal that isn't flush. and do some more damage than if you had the liner.
Prob the same reason why you need foam on a roll cage.