Script doesn't work fully on other objects

Actually I just solved this by copying the original code and pasting it to a new script, but if anyone knows what actually causes this I would be thankful:

While prototyping and testing I wrote a simple script for my sphere (with a cube on one side to signify the facing, made in to a prefab and the sript assigned to it) in which W moves it forward and A and D rotate it to left and right, but now if I use the same script for any other object (be it a unity primitive or a blender object or even a copy of the same prefab) it won’t rotate anymore. The script has been assigned correctly, since it moves forward just fine. What gives?

Please share your script here, using the proper tags. Very difficult to help when we cant see the code.

Yeah, thought of that at first but since
a) there were no changes in the previously working code
b) the code worked just fine when I copy-pasted it 1:1 to another script (excluding the class name, ofc)
I deemed it unnecessary. If I had changed anything in the code, then yes, this would’ve been included.

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

public class Player : MonoBehaviour
{
    // Start is called before the first frame update
    public float speed = 5f;
    public float turnSpeed=45f;
   

    void Start()
    {      
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.LeftShift))
            speed = 10;
        else
            speed = 5;       

        if (Input.GetKey("w"))
        {           
            transform.Translate(Vector3.forward * speed * Time.deltaTime);           
        }
          
        if (Input.GetKey("a"))
        {
            transform.Rotate(Vector3.up * -turnSpeed * Time.deltaTime);
        }
        if (Input.GetKey("d"))
        {
            transform.Rotate(Vector3.up * turnSpeed * Time.deltaTime);
        }
    }
}

More relevant information would perhaps have been the version I’m using (which I also forgot to mention) which is 2019.2.17f1