"because of" are not interchangeable.
"Due to" should be used when describing a noun.
"Because of" should be used when describing a verb.
A good test is to replace the phrase with "caused by" and if it makes sense then you can use "due to" but if it doesn't make sense then you should use "because of".
The cancellation was due to rain.
The game was canceled because of rain.
Source:
https://www.rd.com/culture/difference-between-due-to-and-because-of/