OP's maths is plausible.
The specific heat capacity of water is 4,200 Joules per kilogram degree centigrade. One litre of water is, of course, one kilo.
If you assume that the mains water coming in is 8 degrees and is heated to 40, then to heat up 300 litres of water by 32 degrees would require 300 x 4200 x 32 = 40,320,000 Joules of energy.
There are 3,600,000 Joules in a kilowatt hour (the unit we use for energy tarriffs - a watt is the consumption of one Joule per second) so the 40,320,000 Joules works out at 11.2kWh.
Current electricity price cap is 27.69p per kWh so that's just over £3.10 if 300 litres is heated using electricity.
United Utilities - other water companies are available - prices metered water at 0.475p per litre including foul charges. (Earlier I used 0.365 but that was the 2024/25 rate - thanks Google AI for getting it wrong and putting it as my top search result). So 300 litres on a UU meter would be £1.43.
The overall cost of a 300l bath in these circumstances is actually over £4.50 so assuming the bath isn't filled to the brim £3.50 is certainly in the right ballpark.