Switching university after master's to do PhD somewhere else
Trying to hold you hostage by withholding a letter of reference is highly unethical. If they would do that to you, you're probably better off leaving without a letter from them than staying. Otherwise they may be willing to take advantage of you in other ways if you stay for your PhD. Besides, would you ever really be able to trust each other after such behavior?

In the end, they may be disappointed, but if they've gotten several good articles with you during your master's, you've held up your end of the implicit deal in getting a master's degree. Lots of folks (in some countries and some fields) move between master's and PhD. This is normal. They will probably be willing to write you a good letter after they have some time to reflect.