PHY to PHY connection (KSZ9477S and DP83849IF)
So I've managed to solve the problem by doing three things: I've placed capacitive coupling (0.1 uF) between DP83849IF and KSZ9477S, also I've placed 49.9 pull ups on DP83849IF side, and the last thing I did was turning off autonegotiation on KSZ9477S chip. So now there is no packet loss.