I am not sure about the details, but I have read several times on this forum that ngSpice does not directly support potentiometers, and you have to model it as two resistors and a formula, like in the post below:
But when reading the ngSpice manual, apparently it does support potentiometers:
12.2.34 Potentiometer
Description: A resistance potentiometer with three connections: r0, wiper , and r1.
Parameter position determines the lower and upper portions of the resistance.
Rlower is located between r0 and wiper, Rupper between wiper and r1. If log is
set to FALSE, Rlower = position ∗ r. If log is set to TRUE, then
Rlower = r ∗ 10 −position∗log_multiplier . For Rupper we always have
Rupper = r − Rlower. position <= 0 is resolved to position = 1e − 9,
position >= 1 is resolved to position = 0.999999999.
Also, via this search:
https://forum.kicad.info/search?expanded=true&q=potentiometer%20%23schematic%3Asimulation-ngspice
you find: