Three-way switch wiring question

This is how I did it. Works perfectly. It relies on having the AC input power and the output to the light being in the same box.

In your diagram, you only have 1 traveler wire running to the second switch? I’ve never seen that before. If all you have running to the second switch is a single red traveler wire, and ground I’d be leery as others have said about re-purposing the ground wire.