The frame must be isolated from the motor else your DCC would not have worked. From that we can say no, the frame connected to the right rail is not a problem.
But, it is still not a good setup. Frame isolated and motor isolated is the way to go. Notice there are threads on his very forum about locos occasionally or intermittently getting shorts. There are any number of reasons for these problems however the probability of such an occurrence is increased when alternate (not deliberate) current paths exist. Frames connected to power source is one such possible current path. Hence the advice to isolate everything from everything. It lowers the possibility of future problems.