There is no fallacy here. The primary pitfall here is not one of logic, but one of semantics.
In abstract terms, your title describes a correct deduction. If A only occurs because B always causes it, then when A does not occur, B must not have happened. In an indicative mood, if we are being perfectly careful, this is what we mean, because we have "open quantification". Unfortunately, English does not make that a rule, because the subjunctive markers in English have evolved into a useless mess, and can therefore be omitted at any time.
You can make the statement without implying the always. If B only sometimes causes A, then obviously in those cases when it fails to do this causing, you have B and not A. But in that case, you should say B may cause it, not that it does cause it.
You can also make the statement without implying the only. But in that case you should say A may be caused by B, not that it is caused by B. It might occur for other reasons. But that omission still allows you to deduce that if you don't have A, B wasn't there.
So this English statement can have three different meanings with very different logical implications. You can only tell if you know your speaker is an absolute pedant, or by context. And deduction in your title is only true for two of them.
This ambiguity is one way of seeing what is wrong with your first example.
For example, "You are rich because you are blessed (God blessed you with riches). If you are not rich then you must not be blessed (God chose not to bless you oh ye of little faith)."
'You are rich because you are blessed' only means that riches is one possible effect of being blessed, not that they are always an effect. Any blessing may cause riches, it is not true that every blessing does cause riches. It can happen that one person is rich because he was blessed, but that another person would be blessed in a different way.
Second example, "By the super secret law of attraction you can manifest riches in your life. If you don't have riches it is because you did not attract it into your life you stupid idiot. It's so easy. Do you hate money?"
This does not have either problem, the the modal is there to clarify. So the claim really is that doing B will always cause A for you, and the deduction is valid. But a valid deduction from a false premise is still no good. Not really a problem of logic or semantics, just a problem of having the wrong facts.