If it needs immortality then I'd say it's something that would kill the user otherwise. Then it also depends on what kind of immortality Law's fruit can give. Is it biological longevity or is it that they can always regenerate from any damage (or both)? If it's regeneration the treasure causes physical harm to the user that would usually kill them.
If they let Doffy use CP0 to appease him, it could be that they want him to keep quiet about the treasure. But if you need Law's fruit, why hide the treasure's existence? It could be that the treasure can't be moved, so Doffy can give away the exact location in Mariejois and any powerful pirate could kidnap Law and attack. It could be its existence reveals something about the world's history, like the location of One Piece or something about Joy Boy (like if it's Joy Boy's heart). They're not worried about Law himself because he doesn't know enough about the treasure or if he does know enoufh6he's too weak to invade mariejois and too unreliable of a source to convince anyone to risk invading mariejois, or because he has to die to do the immortality surgery, so the use of the treasure can only happen if either he agrees to kill himself (eg low self-esteem or to save someone else) or if someone kills him, then waits for his fruit to regenerate and feeds it to Blackbeard, since he can have two fruits so could have a way to do the immortality surgery on himself or on someone else without dying.
Another theory I have is the treasure could be whatever killed Roger. I think Roger told Whitebeard he doesn't have long left, which could be that he was ill with something, maybe something he found in Raftel. Maybe the treasure is something that can give power, but also makes you ill and die (reminds me of seeing the "truth" in FMA) and they took it from Roger after it already made him ill. With Law's immortality surgery you can harness its power without dying.
If it's something to do with longevity and not regeneration, maybe it causes aging. All I can think of is it could allow you to see the void century for yourself, like a strong acid trip, but it means your body ages like you've been alive since the void century, so you instantly become 900 years old and die.