You are still thinking to much in "imperative programming" terms. SwiftUI is "declarative".
The var body of a View is no regular Swift function, it is a @ViewBuilder. This means only a subset of Swift is allowed there. Like generating Views and some conditional statements.
Regular "imperative" code like weightKg = weight/2.205 is not allowed.
You have to derive all of the View's state from your model. Some Views like Button have closures which can contain "imperative" code. You can do/cause calculations there or in your model.
Better would be to bind the weight variable to the input field of a View and make a calculated var for the other weight which is used by a Text for example.
@State var weight = 175.0
var weightKg:Double{
return weight/2.205
}
var body:some View{
// ...
SomeInput($weight) // SomeInput is not really an existing type, you would have to look up the correct syntax for TextField for example
Text("weight in kg: \(weightKg)")
// ...
}