The lid switch sensor is U21 on the power button board.
According to the schematic it shows that it is a SA00004PT00 but I can't find the datasheet or any other information online regarding what type of sensor it is, e.g. hall sensor (magnetic) or a light sensor.
There should be +3V on pin 2 and an Earth on pin 1. The output is on pin 3.
Check if the output changes when hovering a magnet over U21 or perhaps covering it so that no light can get to it.
The output is directed to the keyboard controller on the motherboard.
The digital mic array data and clock leads connects to pins 23 & 24 of the eDP cable which then connects to the audio IC ALC283-CG
I think that the lid switch is mounted near the power button so either run a magnet near (around) the same area or cover it up and check if the display turns off/on
The mic is not there it is near the camera in the lid.
Have you checked in Control Panel - Sound - Recording to see if the mic is detected and selected as default?
If it is determined that the microphone is faulty, here's the hardware maintenance manual for the laptop. Go to p.78 to view the procedure to remove/replace the camera module. The microphone is mounted on it. The part number for the module is 5C20F78822.
Search online using the part number only to find suppliers that suit you best.