From what I've seen it's probably a BUK instead of an s300 but most sources agree that it's ukrainian. The missile was probably trying to intercept another one and something went wrong so I doubt it's intentional
From what I've heard it's a Buk-M1 with a failing guidance system that was used to intercept a Russian missile attack on military infrastructure. Why it failed is guesswork but missing maintenance/deterioration is rather likely.