Bounciness changes in inspector but doesn't ACTUALLY change. My ball bounces to the same height

void OnTriggerEnter2D(Collider2D other)
{
    if(other.gameObject.tag == "Powerup")
    {
        powerUpEnabled = true;
        PowerUpStart();
        other.gameObject.SetActive(false);
        Invoke(nameof(PowerUpEnd),timeLeft);
    }  
    if(other.gameObject.CompareTag("Portal"))
    {
        isTeleport = true;
        initialPosition = transform.position;
        originalVelocity = rb.velocity;
        rb.velocity = Vector2.zero;
        rb.gravityScale  = 0;
        objMesh.enabled = false;
        Invoke("TeleportFinal",FindObjectOfType<CamFollow>().teleportTime);
    }    
}
 
void PowerUpStart()
{
    rb.mass*=3;
    coll.sharedMaterial.bounciness = 0.5f;
    Debug.Log("Power up started");
}

void PowerUpEnd()
{
    Debug.Log("Power Up ended");
    rb.mass/=3;
    coll.sharedMaterial.bounciness = 0.97f;
    powerUpEnabled = false;
    timeLeft = 3f;
}

Also the same code works in 3D (with necessary changes like changing from Collider2D to Collider). I have read some posts about this issue but none of the solutions seem to work for me. Any help would be appreciated as this mechanic is really important to me for a game Jam. We have to submit our game in 1.5 days.

I have tried many things like applying a new physics material to my collider by writing

coll.sharedMaterial = lessBouncy;

Here I defined lessBouncy in the Start() function of my code:

PhysicsMateral2D lessBouncy;
lessBouncy = GetComponent<PhysicsMaterial2D>();

ANY help would be appreciated!

Thanks!

Have you tried applying the different materials to the RigidBody rather than the collider to see if it makes any difference?
When I want to change the behavior of the physics material, I make two PhysicsMaterials2D assets in the project with the settings I want, then apply the one I want to the Ribidbody2D in code. The documentation says that the material assigned to the collider has priority over the material defined in the Rigidbody, so what you are doing seems like it should work.