Dont now if the black tar used to keep polythene in place is factory ! But it gets everywhere so I removed it and attached the new PVC with magnetic tape , works great and no mess .
The sealant will be to keep moisture out of the cabin as rain water passes down out of the door drain holes. Personally I would have left the sealant on… unless my car was in a dry climate.
Edit… just seen your “after” picture. looks nice and if the magnetic tape keeps the moisture out then great.