If your mac is having trouble recognizing a replacement battery or other components, you may need to repair your main disk permissions. Follow this
How to Verify & Repair Permissions in OS X El Capitan
How to repair a Mac disk with Disk Utility - Apple Support
How to Start Up a Mac in Internet Recovery Mode - iFixit Repair Guide
How to create a bootable USB drive - iFixit Repair Guide
iFixit: Apple's MacBook Pro Self-Service Repairs Are Expensive
Using Disk Utility to Repair Hard Drives and Disk Permissions
iFixit Has a Bone to Pick With Apple Over Its Self-Service Repair
Did my MacBook die?
My MacBook is broken and I need help fixing it. : r/macbookpro
How to Repair Disk Permissions on Mac - Make Tech Easier