player movment not working well after collid whit enemy

player movement not working well after Clash whit enemy, after colliding whit enemy for few secs he stop follow the mouse correctly

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class playermovment : MonoBehaviour
{
    [SerializeField]
    float MoveSpeed = 0.34f;
    Vector2 MouseInWorld;


    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
        MouseInWorld = Camera.main.ScreenToWorldPoint(Input.mousePosition);
        transform.position = Vector3.Lerp(transform.position, MouseInWorld, MoveSpeed);
    }

}

and this is the enemy movment (this keep work ,this follow the player)

float distance = Vector3.Distance(player.position, transform.position);
         Vector3 direction = player.position - transform.position;
         float angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;
         rb.rotation = angle;
         direction.Normalize();
         movement = direction;

Is your collider an isTrigger? If not then you are going to bump into another solid object and the movement will be stalled, appearing to “not work well”. The reason is that your player’s collider is solid but so is your enemy. Therefore, you are running into a wall, basically, with the same mass. The Rigidbody2D psychics kick in upon collision. Depending on your type of game, perhaps you could use AddForce() to knock the player away and re-open the path. Another solution would be to use Ray-cast/Line-cast to detect the enemy and make the player move around the enemy and stay on path.