The transistor and resistor form a potential divider. When the transistor is fully on, then it has very little voltage across it and all of the 400V is across the resistor, but when the transistor is off, it will have 400V across it.
You won't be able to find a BJT rated to take 400V and 0.4A simultaneously, the safe operating area of any BJT will be exceeded, even 200V at 0.2A will be a challenge, as that will be the point where there's maximum power dissipation in the transistor. Several transistors could be connected in cascode configuration to split the voltage across the devices.