I got the issue that when i merge a video with no sound it gave me an error. I resolved it by changing some code i.e.
if let audioAsset: AVAssetTrack = asset.tracks(withMediaType: .audio).first{
try audioTrack.insertTimeRange(timeRange, of: audioAsset, at: currentTime)
}
but then it started merging one video with no sound and other with sound but if both videos are without sound the export session gives an error of operation failed.