It's not an UB
As long as you know what you're doing, it's OK to use anything as long as they can be compiled, that's how the unsafe works
If the UnsafeCell write at very begining of &T reading, it's an UB. If that never happens, then it's safe for using it.