Is It Safe To...?

No, no! The Y-cable you need is STEREO → 2xMONO.

But I wouldn’t bother. Usually just running guitar cable from headphone output to audio interface works well. Yes, it shorts the right channel of you amp’s headphone output, but I haven’t yet met a headphone amp, which can’t handle a short-circuit.

OTOH, why do you want to record signal from headphone out of your amp? Usually big part of the guitar sound is generated by the speaker. That’s why we usually put a microhone in the front of the speaker.