Use another ethernet cable. You'll find one that locks into place. The NIC on the MacBook needs the ethernet plug to enter just a tiny fraction deeper than usual before its ledge allows the ethernet plut to click into locked position. Some cable connectors have a fitment tolerance than doesn't quite allow it to go deep enough. It's only a fraction of a mm, but that means some RJ-45 plugs won't lock into place unless you push the in quite hard. That's probably not a great idea, so I suggest trying some other cables and you will find one that does lock into place.
I guess one could also carefully sand the end of the RJ45 plug so it goes in deeper, but I've not tried that tact.