I have checked that spaces X and Y are complementary, B is a matrix that consists of basis of X and Y.

The formula for projection matrix I have deduced I saw first during my classes. I cannot understand why my solution is wrong. (P is not even symmetric)