It's not a total loss though. If they do find you valuable, play hard on your salary.
This can lead to some pretty weird hierarchy where a people manager at the director level is managing an engineering manager at the VP level. However, I feel it is a pretty interesting environment and lets both "knowledge works" and "people managers" be rewarded on equal footing.
In aggregate, peoples' behaviors are very predictable. Before every action, ask if this kind of thing would endear a toddler to you or not. If it would, it's a good thing to do. If it wouldn't, it's going to be an uphill battle and you'll have to do many toddler-approved things to undo the damage.
This is why you should bring donuts for the office every week; toddlers love getting edible treats, and so do grownups. Make sure everyone knows you're the one who brought them, without looking like you're making sure everyone knows that you're the one who brought them. This will make people like you more.
Turn your desk around and start going to all their meetings. Say supportive and encouraging things. Make irrelevant broad, philosophical statements, literally stuff you'd find on motivation posters. You'll get popular fast.
If you care about your career, you must realize that your actual job is only ~20% of what you're paid for. You're really paid to be likeable and charming, someone that everyone wants to keep around the office. Do whatever you have to do to keep your code limping along and then put the rest of your energy into becoming popular. You'll be promoted and tasked to hire a version of yourself that hasn't learned these lessons yet, and the cycle will continue.
You're not going to get promoted. That's just a bullshit game they play to pressure you into putting in more hours.
If it ain't in writing, it don't exist.
All that has put me at odds with management to a degree. However, im given all the hard problems and churn out solutions. Based on projects completed, im doing the work of 4 employees at the same level. I should also add that I still answer 5 - 20 questions from coworkers a day, and am the go-to guy to fix many issues (so I dont completely shut myself off). This has put me in a position where my manager has hinted that im going to get promoted if I keep it up.
Of course the company I work for has "non-management management" i.e. you can become a VP without having to manage people. This lets the anti-social hard-core workers still move up in rank and pay.