See the post on using out parameter to return by ref
Q: Return by reference is very common in C++, but there’s a common pitfall, that everyone must always remember?
A: pointee object’s lifetime (not “scope”).
Q2: common, practical safeguards?
A: return a field by reference, where the host object has a longer lifetime
A: return a static object by reference, either class-static, global variables, or function-static. P150 [[NittyGrittyC++]] has a useful example.