If the problem has already been fixed, then to the OP's question, the differences between 105 and Ultegra are weight and smoothness, but successive generations have been getting better, so a later generation of 105 might be just as good or better than Ultegra from a previous generation.
None of that matters if it's not adjusted properly. The stop limit screws prevent the chain from falling off the edge of the cassette, assuming no bent derailleur hanger. The cable tension adjustment and shifters control the shifting in between those stops.