I can only relate what I just went through with the grandsons car. We couldn't get the O2 sensor to work reliably and it would not go into closed loop either. After verifying the wiring to the O2 sensor was intact and the signal was present at the connector on the ECM, we finally tried a spare ECM from the donor car. The replacement of the ECM corrected the closed loop operation and the O2 sensor became active as it should be. The one thing we did notice is the car will not go closed loop just sitting and idling but must be driven a bit before it will engage.
As for the knock sensor, I had a related issue many years ago, where I didn't get a knock indication when I should have, like hitting a bracket on the front of the engine with the engine idling. In that case I changed the ECM as well and it has been fine since. If you can get the engine to stay running, maybe a helper will be required, get the knock signal up in diagnostics and see if it is increasing just sitting and idling and if that is okay, hit one of the brackets for a front accessory and see if the numbers jump. Constant knock or intermittent will reduce spark timing but I wouldn't believe it would kill the engine.