It's literally a question of 1\4 of a mm. You noticed that if magnet pushed right in. It will fold go off and it will not light up again until you put like a screwdriver against magnet. My solution. Use some T or B7000 glue and put a good layer under magnet and also a tiny bit to stop it touching frame. Manoeuvre it while it's setting and then press it a little while you do your open and closing. You'll know what I mean. Too far against frame and it will do the close and not come on. Too far out (raised) and it will literally do what yours is doing. Stays on even when shut. (I nearly stayed with this as I knew I could at least use fingerprint power button to turn it off at least. Which was better than I had originally where it wouldn't go on unless I put screw driver or metal object that would cling magnet. When that happened it stayed on power button or any action until I closed it again.) Anyhow I got it perfect in the end, and I had same, with black cover over. I think personally the little bit of glue...
Just a note. Replacement transparent back rear glass looks so sick. You can get an original and remove the foil colour, but ive found them already to go with logo on ebay. They look soooo good. Enjoy... Easy fixes
put 2 screens on mine and now 3 backs. Dont ever buy them from ali express or if they are less than at least £90 as they are just standard glass...wont even survive some pocket coins.