It’s going to be down to the gauge of the wire and if it’s rated for hard usage. There would be no difference if the 4m cable was the same gauge and insulation type as two 2m cables connected by cord and plug. You couldn’t say how dangerous it is specifically without calculating the load, wire ampacity, ambient temperature, insulation type, distance, and on and on so it’s general advice to prevent fires from overheating wires.
It’s going to be down to the gauge of the wire and if it’s rated for hard usage. There would be no difference if the 4m cable was the same gauge and insulation type as two 2m cables connected by cord and plug. You couldn’t say how dangerous it is specifically without calculating the load, wire ampacity, ambient temperature, insulation type, distance, and on and on so it’s general advice to prevent fires from overheating wires.