In both of your examples you could substitute "because of," but "from" and "out of" can't be exchanged here. Perhaps you can suggest a few more examples which may clear up the difference between the two expressions.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.